package lambdapi

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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)
OCaml

Innovation. Community. Security.