mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-19 09:28:20 +03:00
85ad65b026
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.
17 lines
436 B
Plaintext
17 lines
436 B
Plaintext
BBT.new_node
|
|
: ∀(K: *)
|
|
∀(V: *)
|
|
∀(key: K)
|
|
∀(val: V)
|
|
∀(lft: (BBT K V))
|
|
∀(rgt: (BBT K V))
|
|
(BBT K V)
|
|
= λK λV λkey λval λlft λrgt
|
|
use P = λx (BBT K V)
|
|
use new = λlft.size λlft
|
|
use P = λx (BBT K V)
|
|
use new = λrgt.size λrgt
|
|
use new_size = #(+ #1 (U60.max rgt.size lft.size))
|
|
(BBT.bin K V new_size key val lft rgt)
|
|
(~(BBT.got_size K V rgt) P new)
|
|
(~(BBT.got_size K V lft) P new) |