Documentation

Cedar.Thm.SymCC.Term.Same

Properties of the Same predicate on Terms #

This file contains lemmas about the Same predicate on Terms.

theorem Cedar.Thm.same_outcomes_implies_eq {o₁ o₂ : Spec.Outcome Spec.Value} {t : SymCC.Term} :
o₁ ∼ t → o₂ ∼ t → o₁ = o₂
theorem Cedar.Thm.same_error_foldr_ifSome {e : Spec.Error} {ts : List SymCC.Term} {P : SymCC.Term} {ty : SymCC.TermType} {tⱼ : SymCC.Term} (hP : P.typeOf = ty.option) (hj : tⱼ ∈ ts) (hsame : Except.error e ∼ tⱼ) :
Except.error e ∼ List.foldr (fun (tᵢ acc : SymCC.Term) => SymCC.Factory.ifSome tᵢ acc) P ts

If some guard in the list corresponds to an errored evaluation (so it is a none), the whole ifSome fold reduces to that error.

theorem Cedar.Thm.record_value?_find?_required {a : Spec.Attr} {tₐ : SymCC.Term} {rt : Data.Map Spec.Attr SymCC.Term} {rv : Data.Map Spec.Attr Spec.Value} (hw : rt.WellFormed) (hty : ∀ (ty : SymCC.TermType), tₐ.typeOf = ty.option → False) (hf : rt.find? a = some tₐ) (hr : (SymCC.Term.record rt).value? = some (Spec.Value.record rv)) :
∃ (vₐ : Spec.Value), rv.find? a = some vₐ ∧ tₐ.value? = some vₐ
theorem Cedar.Thm.same_value_inj {t₁ t₂ : SymCC.Term} {v : Spec.Value} {εs : SymCC.SymEntities} :
SymCC.Term.WellFormed εs t₁ → SymCC.Term.WellFormed εs t₂ → t₁.typeOf = t₂.typeOf → v ∼ t₁ → v ∼ t₂ → t₁ = t₂