package lambdapi

  1. Overview
  2. Docs
Proof assistant for the λΠ-calculus modulo rewriting

Install

Dune Dependency

Authors

Maintainers

Sources

lambdapi-2.5.1.tbz
sha256=2c251021b6fac40c05282ca183902da5b1008e69d9179d7a9543905c2c21a28a
sha512=69535f92766e6fedc2675fc214f0fb699bde2a06aa91d338c93c99756235a293cf16776f6328973dda07cf2ad402e58fe3104a08f1a896990c1778b42f7f9fcf

doc/src/lambdapi.core/coercion.ml.html

Source file coercion.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
open Common
open Term

let coerce : sym =
  let id = Pos.none "coerce" in
  Sign.add_symbol Ghost.sign Public Defin Eager false id None mk_Kind []

let apply a b t : term = add_args (mk_Symb coerce) [a; b; t]

let _ =
  (* Add the rule [coerce $A $A $t ↪ $t] (but we don't have access to
     the parser here) *)
  let rule =
    let lhs =
      [ mk_Patt (Some 0, "A", [||])
      ; mk_Patt (Some 0, "A", [||])
      ; mk_Patt (Some 1, "t", [||]) ]
    in
    let vars = [|new_tevar "A"; new_tevar "t"|] in
    let rhs = _TEnv (_TE_Vari vars.(1)) [||] in
    let rhs = Bindlib.(bind_mvar vars rhs |> unbox) in
    let arity = 3 in
    let arities = [|0; 0|] in
    { lhs; rhs; arity; arities; vars; xvars_nb = 0; rule_pos = None }
  in
  Sign.add_rule Ghost.sign coerce rule
OCaml

Innovation. Community. Security.