Propositional formulas #
A propositional formula over variables of type ν.
This is the inductively defined syntax of formulas.
Later on we can take a quotient to identify x ∨ ¬x with ⊤, for example.
- var {ν : Type u} (x : ν) : PropForm ν
- tr {ν : Type u} : PropForm ν
- fls {ν : Type u} : PropForm ν
- neg {ν : Type u} (φ : PropForm ν) : PropForm ν
- conj {ν : Type u} (φ₁ φ₂ : PropForm ν) : PropForm ν
- disj {ν : Type u} (φ₁ φ₂ : PropForm ν) : PropForm ν
- impl {ν : Type u} (φ₁ φ₂ : PropForm ν) : PropForm ν
- biImpl {ν : Type u} (φ₁ φ₂ : PropForm ν) : PropForm ν
Instances For
Equations
- Trestle.Model.instReprPropForm = { reprPrec := Trestle.Model.reprPropForm✝ }
Equations
Equations
- (Trestle.Model.PropForm.var a).toString = toString a
- Trestle.Model.PropForm.tr.toString = "⊤"
- Trestle.Model.PropForm.fls.toString = "⊥"
- a.neg.toString = toString "¬" ++ toString (Trestle.Model.PropForm.toString.go a) ++ toString ""
- (a.conj a_1).toString = toString "" ++ toString (Trestle.Model.PropForm.toString.go a) ++ toString " ∧ " ++ toString (Trestle.Model.PropForm.toString.go a_1) ++ toString ""
- (a.disj a_1).toString = toString "" ++ toString (Trestle.Model.PropForm.toString.go a) ++ toString " ∨ " ++ toString (Trestle.Model.PropForm.toString.go a_1) ++ toString ""
- (a.impl a_1).toString = toString "" ++ toString (Trestle.Model.PropForm.toString.go a) ++ toString " → " ++ toString (Trestle.Model.PropForm.toString.go a_1) ++ toString ""
- (a.biImpl a_1).toString = toString "" ++ toString (Trestle.Model.PropForm.toString.go a) ++ toString " ↔ " ++ toString (Trestle.Model.PropForm.toString.go a_1) ++ toString ""
Instances For
Equations
Equations
Equations
Instances For
Equations
Instances For
The unique extension of τ from variables to formulas.
Equations
- Trestle.Model.PropForm.eval τ (Trestle.Model.PropForm.var a) = τ a
- Trestle.Model.PropForm.eval τ Trestle.Model.PropForm.tr = true
- Trestle.Model.PropForm.eval τ Trestle.Model.PropForm.fls = false
- Trestle.Model.PropForm.eval τ a.neg = !Trestle.Model.PropForm.eval τ a
- Trestle.Model.PropForm.eval τ (a.conj a_1) = (Trestle.Model.PropForm.eval τ a && Trestle.Model.PropForm.eval τ a_1)
- Trestle.Model.PropForm.eval τ (a.disj a_1) = (Trestle.Model.PropForm.eval τ a || Trestle.Model.PropForm.eval τ a_1)
- Trestle.Model.PropForm.eval τ (a.impl a_1) = Trestle.Model.PropForm.eval τ a ⇨ Trestle.Model.PropForm.eval τ a_1
- Trestle.Model.PropForm.eval τ (a.biImpl a_1) = decide (Trestle.Model.PropForm.eval τ a = Trestle.Model.PropForm.eval τ a_1)
Instances For
Satisfying assignments #
An assignment satisfies a formula φ when φ evaluates to ⊤ at that assignment.
Equations
Instances For
This instance is scoped so that τ ⊨ φ : Prop implies φ : PropForm _ via the outParam
only when PropForm is open.
Equations
Instances For
Equations
- Trestle.Model.PropForm.instDecidableEntailsPropAssignment τ φ = match h : Trestle.Model.PropForm.eval τ φ with | true => isTrue h | false => isFalse ⋯
Semantic entailment and equivalence #
A formula φ₁ semantically entails φ₂ when τ ⊨ φ₁ implies τ ⊨ φ₂.
This is actually defined in terms of the Boolean lattice
to reuse various le_blah theorems,
and the above statement is a theorem (entails_ext).
Equations
- φ₁.entails φ₂ = ∀ (τ : Trestle.Model.PropAssignment ν), Trestle.Model.PropForm.eval τ φ₁ ≤ Trestle.Model.PropForm.eval τ φ₂
Instances For
An equivalent formulation of semantic entailment in terms of satisfying assignments.
Two formulas are semantically equivalent when they always evaluate to the same thing.
This is a strong notion of equivalence.
See equivalentOver for a weaker one.
Equations
- φ₁.equivalent φ₂ = ∀ (τ : Trestle.Model.PropAssignment ν), Trestle.Model.PropForm.eval τ φ₁ = Trestle.Model.PropForm.eval τ φ₂
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.