SE381-08 (Week 4, lecture 2)
Logic
Simple predicates
Relations as predicates
Test whether a specified pair is a member of a relation
Simple: use "\in" or "\notin"
Infix/prefix notation (more on this later if we have time)
Logical connectives (review from prerequisite assessment)
Conjunction (AND), disjunction (OR), negation (NOT), equivalence, implication
Quantifiers
Components
Type symbol
Bound variable declarations
Restriction (optional -- more later)
Predicate
Types
Universal
"For all"
Equivalent to ... AND ... AND ... AND ...
Existential
"There exists"
Equivalent to ... OR ... OR ... OR ...
Schema calculus
Schema review
Format: declarations, predicates
State schema
Declarations: state variables
Predicates: invariants
Operation schemas
Declarations: included schemas, input/output variables
Predicates: preconditions, "actions", unchanged state
Types of operations
"Read-write": change of state (Delta notation)
"Read only": no change of state (notation?)
Xi notation
Includes "Delta" schema
Adds "no change" predicates (xx' = xx)
Supplementary and total operations
Real operations often have multiple "cases"
"Normal" operation execution
"Alternate" operation execution
"Exceptional" conditions
Define one operation schema for each case
Often, include a "status" variable to report selected case
Combine multiple partial operations
Using schema calculus (often OR)
Result is a total operation (handles all cases) . . .
. . . or does it? (That's one thing the theorem prover is for!)
Summary of schema calculus operations
Conjunction
Disjunction
Composition
Symbol -- funny semicolon (";")
Combines two schemas
Each schema has before (unprimed) and after (primed) states
Added predicates (or "renaming") specify equality between "after 1" and "before 2"
Net effect is as if schemas 1 and 2 were applied one after the other
Piping
Symbol -- funny ">>"
Also combines two schemas
But, the equality/renaming exists between "output 1" variables ("!") and "input 2" variables ("?")
Net effect is as if the output of schema 1 were "piped" to the inputs of schema 2