Documentation

Cedar.Thm.SymCC.Opt.Compiler

@[irreducible]

Lemma that Opt.compile produces a well-formed footprint set.

theorem Cedar.Thm.Opt.compile.correctness.lit (p : Spec.Prim) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.lit p) εnv = do let termSymCC.compile (Spec.Expr.lit p) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.lit p) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- lit case

theorem Cedar.Thm.Opt.compile.correctness.var (v : Spec.Var) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.var v) εnv = do let termSymCC.compile (Spec.Expr.var v) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.var v) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- var case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.ite (x₁ x₂ x₃ : Spec.Expr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (x₁.ite x₂ x₃) εnv = do let termSymCC.compile (x₁.ite x₂ x₃) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (x₁.ite x₂ x₃) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- ite case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.andor (x₁ x₂ : Spec.Expr) (εnv : SymCC.SymEnv) :
(SymCC.Opt.compile (x₁.and x₂) εnv = do let termSymCC.compile (x₁.and x₂) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (x₁.and x₂) εnv Except.ok { term := term, footprint := footprint }) SymCC.Opt.compile (x₁.or x₂) εnv = do let termSymCC.compile (x₁.or x₂) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (x₁.or x₂) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- and and or cases

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.unaryApp (op : Spec.UnaryOp) (x : Spec.Expr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.unaryApp op x) εnv = do let termSymCC.compile (Spec.Expr.unaryApp op x) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.unaryApp op x) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- unaryApp case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.binaryApp (op : Spec.BinaryOp) (x₁ x₂ : Spec.Expr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.binaryApp op x₁ x₂) εnv = do let termSymCC.compile (Spec.Expr.binaryApp op x₁ x₂) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.binaryApp op x₁ x₂) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- binaryApp case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.getAttr (expr : Spec.Expr) (attr : Spec.Attr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (expr.getAttr attr) εnv = do let termSymCC.compile (expr.getAttr attr) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (expr.getAttr attr) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- getAttr case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.hasAttr (expr : Spec.Expr) (attr : Spec.Attr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (expr.hasAttr attr) εnv = do let termSymCC.compile (expr.hasAttr attr) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (expr.hasAttr attr) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- hasAttr case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.set (ls : List Spec.Expr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.set ls) εnv = do let termSymCC.compile (Spec.Expr.set ls) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.set ls) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- set case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.record (m : List (Spec.Attr × Spec.Expr)) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.record m) εnv = do let termSymCC.compile (Spec.Expr.record m) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.record m) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- record case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness.call (xfn : Spec.ExtFun) (args : List Spec.Expr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile (Spec.Expr.call xfn args) εnv = do let termSymCC.compile (Spec.Expr.call xfn args) εnv have footprint : Data.Set SymCC.Term := SymCC.footprint (Spec.Expr.call xfn args) εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile -- call case

@[irreducible]
theorem Cedar.Thm.Opt.compile.correctness (x : Spec.Expr) (εnv : SymCC.SymEnv) :
SymCC.Opt.compile x εnv = do let termSymCC.compile x εnv have footprint : Data.Set SymCC.Term := SymCC.footprint x εnv Except.ok { term := term, footprint := footprint }

Correctness theorem for Opt.compile:

Opt.compile produces the same term as SymCC.compile, and Opt.compile produces the same footprint as footprint