Equations
- Esolangs.AxOrThm.putInParens s = "(" ++ s ++ ")"
Instances For
Equations
- Esolangs.AxOrThm.showVar i = String.ofList [Char.ofNat (97 + i)]
Instances For
Equations
- Esolangs.AxOrThm.showCall "¬" [a] = Esolangs.AxOrThm.putInParens ("¬" ++ a)
- Esolangs.AxOrThm.showCall "=" [a, b] = Esolangs.AxOrThm.putInParens (a ++ " = " ++ b)
- Esolangs.AxOrThm.showCall "→" [a, b] = Esolangs.AxOrThm.putInParens (a ++ " → " ++ b)
- Esolangs.AxOrThm.showCall "∨" [a, b] = Esolangs.AxOrThm.putInParens (a ++ " ∨ " ++ b)
- Esolangs.AxOrThm.showCall "∧" [a, b] = Esolangs.AxOrThm.putInParens (a ++ " ∧ " ++ b)
- Esolangs.AxOrThm.showCall "∀" [a, b] = Esolangs.AxOrThm.putInParens ("∀ " ++ a ++ ", " ++ b)
- Esolangs.AxOrThm.showCall "∃" [a, b] = Esolangs.AxOrThm.putInParens ("∃ " ++ a ++ ", " ++ b)
- Esolangs.AxOrThm.showCall "+" [a, b] = Esolangs.AxOrThm.putInParens (a ++ " + " ++ b)
- Esolangs.AxOrThm.showCall name args = Esolangs.AxOrThm.putInParens (name ++ if args.length = 0 then "" else "(" ++ " ".intercalate args ++ ")")
Instances For
@[irreducible]
Equations
- e.show = match h : e.expr with | Esolangs.AxOrThm.Expr'.arg i => Esolangs.AxOrThm.showVar (e.depth - i - 1) | Esolangs.AxOrThm.Expr'.call name es => Esolangs.AxOrThm.showCall name (List.map Esolangs.AxOrThm.Expr.show es)
Instances For
@[irreducible]
Equations
- s.show = match h : s.stat with | Esolangs.AxOrThm.Stat'.not { depth := depth, stat := Esolangs.AxOrThm.Stat'.not p } => p.show | Esolangs.AxOrThm.Stat'.not { depth := depth, stat := Esolangs.AxOrThm.Stat'.all { depth := depth_1, stat := Esolangs.AxOrThm.Stat'.not p } } => Esolangs.AxOrThm.showCall "∃" [Esolangs.AxOrThm.showVar s.depth, p.show] | Esolangs.AxOrThm.Stat'.imp { depth := depth, stat := Esolangs.AxOrThm.Stat'.not p } q => Esolangs.AxOrThm.showCall "∨" [p.show, q.show] | Esolangs.AxOrThm.Stat'.not { depth := depth, stat := Esolangs.AxOrThm.Stat'.imp p { depth := depth_1, stat := Esolangs.AxOrThm.Stat'.not q } } => Esolangs.AxOrThm.showCall "∧" [p.show, q.show] | Esolangs.AxOrThm.Stat'.eq a b => Esolangs.AxOrThm.showCall "=" [a.show, b.show] | Esolangs.AxOrThm.Stat'.rel name es => Esolangs.AxOrThm.showCall name (List.map Esolangs.AxOrThm.Expr.show es) | Esolangs.AxOrThm.Stat'.not p => Esolangs.AxOrThm.showCall "¬" [p.show] | Esolangs.AxOrThm.Stat'.imp p q => Esolangs.AxOrThm.showCall "→" [p.show, q.show] | Esolangs.AxOrThm.Stat'.all p => Esolangs.AxOrThm.showCall "∀" [Esolangs.AxOrThm.showVar s.depth, p.show]