Documentation

Projects.Esolangs.Cornucopia.Programs.Prog1

Equations
Instances For
    @[simp]
    @[simp]
    theorem Esolangs.Cornucopia.Prog₁.builtin_not_name_of_mem_fs {name₁ name : String} {d : List ℕ → ℕ} [H : BuiltinC name₁] (h : (name, d) ∈ fs) :
    name₁ ≠ name
    theorem Esolangs.Cornucopia.Prog₁.get!_fsMap {name : String} :
    Map.get! name fsMap = match (motive := Option (String × (List ℕ → ℕ)) → List ℕ → ℕ) List.find? (fun (x : String × (List ℕ → ℕ)) => decide (x.1 = name)) fs with | some p => p.2 | none => Map.get! name builtinFs
    @[simp]
    theorem Esolangs.Cornucopia.Prog₁.not_builtin_mem_fs {name : String} {f : List ℕ → ℕ} [H : BuiltinC name] :
    (name, f) ∉ fs
    @[simp]
    @[simp]
    @[simp]
    @[simp]
    theorem Esolangs.Cornucopia.Prog₁.fs₁_get!_of {fs₁ : Map String (List ℕ → ℕ)} {name : String} (h : CompatibleDefs (Map.ofList defs) fs₁) (d : Def) (h₁ : (name, d) ∈ defs) (h₂ : ∀ (f : List ℕ → ℕ), Map.get! name (Map.ofList defs) = d → Map.get! name (builtinFs ∪ fs₁) = f → Map.get? name fs₁ = some (fn d.arity (d.expr.eval prog (builtinFs ∪ fs₁))) → Map.get? name fs₁ = some f → f = fn d.arity (d.expr.eval prog (builtinFs ∪ fs₁)) → fn d.arity f = Map.get! name (Map.ofList fs)) :
    @[simp]
    @[simp]
    @[simp]
    @[simp]
    theorem Esolangs.Cornucopia.Prog₁.exprAdd_aux (f : ℕ → ℕ → ℕ) (h : ∀ (x y : ℕ), f x y = ((f (x - 1) (y - 1) + 2 - if x = 0 then 1 else 0) - if y = 0 then 1 else 0) - f 0 0) :
    f = fun (x1 x2 : ℕ) => x1 + x2
    theorem Esolangs.Cornucopia.Prog₁.exprIte_aux (f : ℕ → ℕ → ℕ → ℕ) (h : ∀ (a b c : ℕ), f a b c = f a (b - 1) (c - 1) + 1 - ((if a = 0 then 0 else 1) - b) - ((if a = 0 then 1 else 0) - c) - f a 0 0) :
    f = fun (a b c : ℕ) => if a = 0 then c else b
    theorem Esolangs.Cornucopia.Prog₁.exprAddAlt₁_aux (f : ℕ → ℕ → ℕ) (h : ∀ (a b : ℕ), f a b = f a (b - 1) + 1 - (1 - (a - f a (b - 1)) - (f a (b - 1) - a) - b)) :
    f = fun (x1 x2 : ℕ) => x1 + x2
    @[instance_reducible]
    Equations
    @[simp]
    @[simp]
    theorem Esolangs.Cornucopia.Prog₁.eval_prog_ite {a b c : ℕ} :
    prog.eval "ite" [a, b, c] = if a = 0 then c else b