package lambdapi

All checked builds pass
  1. Overview
  2. Docs
Proof assistant for the λΠ-calculus modulo rewriting

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lambdapi-4.0.0.tbz
sha256=0e2e73e0ea0c674f1263bf85ed3453ed3d6084d38eea29974a03ba9e382d29d7
sha512=2831db57fcd09206687a92fc9ee7d363e87bcec5167949e9c8161d41c63d5887b9f3556bfd63a7a9a0c12e5a5dc61a397baf4f496ebdb2a2fce122142c05e7a1

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
open Common
open Term open Sign

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 a = mk_Patt (Some 0, "A", [||])
    and t = mk_Patt (Some 1, "t", [||]) in
    let lhs = [a;a;t] and arities = [|0;0|] and names = [|"A";"t"|] in
    { lhs; names; rhs=t; arity=3; arities; vars_nb=2; xvars_nb = 0;
      rule_pos = None }
  in
  Sign.add_rule Ghost.sign (coerce, rule)