State-indexed predicates #
This module provides a type SPred σs of predicates indexed by a list of states.
This type forms the basis for the notion of assertion in Std.Do; see Std.Do.Assertion.
@[reducible, inline]
A predicate over states, where each state is defined by a list of component state types.
Example:
SPred [Nat, Bool] = (Nat → Bool → ULift Prop)
Equations
- Std.Do.SPred σs = Std.Do.SVal σs (ULift Prop)
Instances For
Logical equivalence of SPred.
Logically equivalent predicates are equal. Use SPred.bientails.to_eq to convert bi-entailment to
equality.
Instances For
Biimplication in SPred: states that either satisfy both P and Q or satisfy neither satisfy
spred(P ↔ Q).
Equations
Instances For
Universal quantifier in SPred.
Equations
- Std.Do.SPred.forall P_2 = { down := ∀ (a : α), (P_2 a).down }
- Std.Do.SPred.forall P_2 = fun (s : σ) => Std.Do.SPred.forall fun (a : α) => P_2 a s
Instances For
Conjunction of a list of stateful predicates. A state satisfies conjunction env if it satisfies
all predicates in env.
Equations
- Std.Do.SPred.conjunction [] = ⌜True⌝
- Std.Do.SPred.conjunction (P :: env_2) = spred(P ∧ Std.Do.SPred.conjunction env_2)