CS 641 Lecture -*- Outline -*- * Boolean expressions (8.1) def: a Boolean expressions is a predicate, i.e., an expression of type S -> Bool ** pointwise extension Usually use the pointwise expended notation def: base term [[e]] associated with e is defined as: [[x: S -> G]] == x : G , for a state attribute of type G [[y]] == y , for a logical variable (e.g. quantified) [[e1.e2]] == [[e1]].[[e2]] [[(\forall i \in I :: b)]] == (\forall i \in I :: [[b]]) [[(\exists i \in I :: b)]] == (\exists i \in I :: [[b]]) Lemma 8.1. Let x1,...,xm be the attributes of an expression e. Then e.s == [[e]][x1,...,xm := x1.s, ..., xm.s] ** reasoning about Boolean expressions (8.2) We want to be able to reduce reasoning about expressions to reasoning about the corresponding Boolean terms. Corollary 8.2 (reduction). Let x1,...,xm be the attributes of a Boolean expression b. Then e.s == (\exists x1,...,xm :: x1 == x1.s /\ ... /\ xm == xm.s /\ [[b]]) This allows proofs to focus on the corresponding terms, avoiding extensionality. Example: consider proving that x <= y \subseteq x - 10 < y Lemma 8.3 (alternative reduction). Let b and c be Boolean expressions, and xet x == x1,...,xm be the attributes that occur in these. Then (a) |- (\forall x1...xm :: [[b]] ==> [[c]]) ==> b \subseteq c (b) var x1...xm |- (forall x1 ...xm :: [[b]] ==> [[c]]) <==> b \subseteq c Example: consider again proving that x <= y \subseteq x - 10 < y