p AND q = (\s. p s /\ q s)Disjunction, negation, and implication can be defined in much the same way. Universal and existensial quantifications are defined like this:
(!!i::P. Q i) s = (!i::P. Q i s) (??i::P. Q i) s = (?i::P. Q i s)And the every where operator is defined like this:
|== p = (!s. p s)(so |== p means the predicate p holds every where.
Let f be a polymorphic function from type 's (state) to 'v (value). Nov is an unspecified value of type 'v. We use it's unspecifiedness is used to model undefinedness. So, when f x returns Nov this is to model the fact that f is undefined in x. This is our way to encode partial functions with total functions.
val Pj_def = |- !f A x. (f Pj A) x = ((A x) => (f x) | Nov)
val pj_def = |- !p V. p pj V = (\s. p (s Pj V))
val pj_COMPO = |- (p pj V) pj W = p pj V AND W val Pj_COMPO = |- (f Pj A) Pj B = f Pj B AND Aval Pj_Pj = |- (f Pj A) Pj A = f Pj A val pj_pj = |- (p pj V) pj V = p pj V
val Pj_EQ = |- !f g A. (f Pj A = g Pj A) = (!x. A x ==> (f x = g x))
val Pj_EQ_MONO = |- !A B f g. |== (A IMP B) /\ (f Pj B = g Pj B) ==> (f Pj A = g Pj A)
val pj_EQUAL = |- p EQUAL q pj V = (p pj V) EQUAL (q pj V) val pj_qAND_GEN = |- RES_qAND W (\i. f i) pj V = RES_qAND W (\i. f i pj V) val pj_qAND = |- RES_qAND W (\i. i) pj V = RES_qAND W (\i. i pj V) val pj_qOR_GEN = |- RES_qOR W (\i. f i) pj V = RES_qOR W (\i. f i pj V) val pj_qOR = |- RES_qOR W (\i. i) pj V = RES_qOR W (\i. i pj V) val pj_AND = |- p AND q pj V = (p pj V) AND (q pj V) val pj_OR = |- p OR q pj V = (p pj V) OR (q pj V) val pj_NOT = |- NOT p pj V = NOT (p pj V) val pj_IMP = |- p IMP q pj V = (p pj V) IMP (q pj V)