The interpretations of dynamic predicate logic #
A formula of DPL/Syntax.lean has two interpretations in a structure M. The dynamic one,
Formula.eval, is Groenendijk and Stokhof's, a relation between assignments, built from the
update algebra of Update.lean, with conjunction as composition, the existential as a random
reset followed by its scope, and everything else a test. The static one is that of predicate
logic, mathlib's satisfaction of the formula read as a first-order formula,
φ.toFormula.Realize. A formula is true at an assignment under the dynamic interpretation when
it has an output there, (φ.eval M).dom; the two notions of truth agree on the scope-bound
formulas (DPL/Context.lean) and differ where a quantifier binds outside its scope.
Main definitions #
DPL.Formula.eval: the dynamic interpretation.
Main results #
DPL.Formula.isTest_eval: a formula with no active quantifier variable is a test.
Implementation notes #
eval is stated through the substrate's dexists and dforall, so that the laws of the update
algebra apply to it as they stand; mem_dexists and mem_dforall unfold them at assignments.
The converse of isTest_eval fails, a test such as x ≐ y ⋏ ∃[x] (x ≐ y) having an active
quantifier variable.
References #
The dynamic interpretation relates the input assignments to their output assignments.
Equations
- DPL.Formula.eval M DPL.Formula.top = SetRel.id
- DPL.Formula.eval M (DPL.Formula.rel R ts) = DynamicSemantics.Update.test {g : V → M | FirstOrder.Language.Structure.RelMap R fun (i : Fin n) => FirstOrder.Language.Term.realize g (ts i)}
- DPL.Formula.eval M (DPL.Formula.equal t₁ t₂) = DynamicSemantics.Update.test {g : V → M | FirstOrder.Language.Term.realize g t₁ = FirstOrder.Language.Term.realize g t₂}
- DPL.Formula.eval M φ.neg = DynamicSemantics.Update.test (DPL.Formula.eval M φ).neg
- DPL.Formula.eval M (φ.conj ψ) = SetRel.comp (DPL.Formula.eval M φ) (DPL.Formula.eval M ψ)
- DPL.Formula.eval M (φ.disj ψ) = DynamicSemantics.Update.test ((DPL.Formula.eval M φ).disj (DPL.Formula.eval M ψ))
- DPL.Formula.eval M (φ.imp ψ) = DynamicSemantics.Update.test ((DPL.Formula.eval M φ).impl (DPL.Formula.eval M ψ))
- DPL.Formula.eval M (DPL.Formula.ex x_1 φ) = DynamicSemantics.Update.dexists x_1 (DPL.Formula.eval M φ)
- DPL.Formula.eval M (DPL.Formula.all x_1 φ) = DynamicSemantics.Update.test (DynamicSemantics.Update.dforall x_1 (DPL.Formula.eval M φ))
Instances For
An existential closure runs its scope from an assignment that differs from the input at most on the closed variables.
A conjunction of tests is the test of their conditions together.
A formula with no active quantifier variable is a test, since atoms, negations, disjunctions, implications and universals are and conjunction preserves it.