Documentation

Cedar.Thm.SymCC.Term.PE

Basic properties of partial evaluation of terms #

This file proves basic lemmas about the Factory functions on terms when applied to literal (concrete) inputs. #

PE for Factory.not #

PE for Factory.and #

PE for Factory.or #

theorem Cedar.Thm.pe_foldl_or {α : Type u_1} (g : α → Bool) (mk : α → SymCC.Term) (st : SymCC.Term → SymCC.Term) (l : List α) (hstep : ∀ (a : α), st (mk a) = SymCC.Term.prim (SymCC.TermPrim.bool (g a))) (s : Bool) :

Left-folding Factory.or over a mapped list, where each element reduces (via hstep) to a boolean literal, yields the boolean literal of the disjunction accumulated over the list (List.any).

PE for Factory.implies #

PE for Factory.ite #

PE for Factory.eq #

PE for Factory.option.get and Factory.option.get' #

PE for Factory.isNone and Factory.isSome #

PE for Factory.ifSome #

ifSome with a none body always reduces to that none.

theorem Cedar.Thm.pe_foldr_ifSome_all_some {l : List SymCC.Term} {P : SymCC.Term} {ty : SymCC.TermType} (hP : P.typeOf = ty.option) (hall : ∀ (t : SymCC.Term), t ∈ l → ∃ (g : SymCC.Term), t = g.some) :
List.foldr (fun (tᵢ acc : SymCC.Term) => SymCC.Factory.ifSome tᵢ acc) P l = P

If every guard is a some, folding ifSome collapses to the body.

Under a foldr ifSome over well-formed-literal option guards, replacing option.get of each guard with option.get' I leaves the folded term unchanged (when a guard is none both sides collapse to none; when all guards are some the two gets agree).

theorem Cedar.Thm.pe_ifSome_ok_get_eq_get' {εs : SymCC.SymEntities} (I : SymCC.Interpretation) {t₁ t₂ t₃ : SymCC.Term} {ty₁ ty₂ : SymCC.TermType} (f : SymCC.Term → SymCC.Result SymCC.Term) (hwφ₁ : SymCC.Term.WellFormedLiteral εs t₁ ∧ t₁.typeOf = ty₁.option) (hty₂ : t₂.typeOf = ty₂.option) (hty₃ : t₃.typeOf = ty₂.option) (hok₂ : f (SymCC.Factory.option.get' I t₁) = Except.ok t₂) (hok₃ : f (SymCC.Factory.option.get t₁) = Except.ok t₃) :
theorem Cedar.Thm.pe_ifSome_ok_get_eq_get'₂ {εs : SymCC.SymEntities} (I : SymCC.Interpretation) {t₁ t₂ t₃ t₄ : SymCC.Term} {ty₁ ty₂ ty₃ : SymCC.TermType} (f : SymCC.Term → SymCC.Term → SymCC.Result SymCC.Term) (hwφ₁ : SymCC.Term.WellFormedLiteral εs t₁ ∧ t₁.typeOf = ty₁.option) (hwφ₂ : SymCC.Term.WellFormedLiteral εs t₂ ∧ t₂.typeOf = ty₂.option) (hty₃ : t₃.typeOf = ty₃.option) (hty₄ : t₄.typeOf = ty₃.option) (hok₃ : f (SymCC.Factory.option.get' I t₁) (SymCC.Factory.option.get' I t₂) = Except.ok t₃) (hok₄ : f (SymCC.Factory.option.get t₁) (SymCC.Factory.option.get t₂) = Except.ok t₄) :

PE for Factory.anyNone and Factory.ifAllSome #

PE for Factory.ifFalse and Factory.ifTrue #

PE for Factory.app #

PE for Factory bitvector operators #

PE for Factory string, set, and record operators #

PE for Factory extension operators #