Kind/book/Kind.if.set.kind2
Victor Taelin 85ad65b026 use-notation
Now, there are two local binders:

let x = ...
use x = ...

The 'let' binder will create a local definition, type-check it, and
assign a name to it. When compiled, it will create 'dup' nodes.

The 'use' binder is just an alias. It will not bind a new variable, and,
when compiled, will create inline copies. Also, for type-checking, it
allows creating aliases that are definitionaly equal for the checker.
2024-03-08 17:39:37 -03:00

45 lines
1.1 KiB
Plaintext

Kind.if.set
: ∀(term: Kind.Term)
∀(P: *)
∀(Y: P)
∀(N: ∀(val: Kind.Term) P)
P
= λterm λP λY λN
use P = λx ∀(Y: P) ∀(N: ∀(val: Kind.Term) P) P
use all = λnam λinp λbod λY λN (N (Kind.all nam inp bod))
use lam = λnam λbod λY λN (N (Kind.lam nam bod))
use app = λfun λarg λY λN (N (Kind.app fun arg))
use ann = λval λtyp λY λN (N (Kind.ann val typ))
use slf = λnam λbod λY λN (N (Kind.slf nam bod))
use ins = λval λY λN (N (Kind.ins val))
use ref = λnam λval λY λN (N (Kind.ref nam val))
use def = λnam λval λbod λY λN (N (Kind.def nam val bod))
use set = λY λN Y
use u60 = λY λN (N Kind.u60)
use num = λval λY λN (N (Kind.num val))
use op2 = λopr λfst λsnd λY λN (N (Kind.op2 opr fst snd))
use mat = λnam λx λz λs λp λY λN (N (Kind.mat nam x z s p))
use txt = λlit λY λN (N (Kind.txt lit))
use hol = λnam λctx λY λN (N (Kind.hol nam ctx))
use var = λnam λidx λY λN (N (Kind.var nam idx))
(~term
P
all
lam
app
ann
slf
ins
ref
def
set
u60
num
op2
mat
txt
hol
var
Y
N
)