Kind/book/BBT.lft_rotate.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

18 lines
551 B
Plaintext

BBT.lft_rotate
: ∀(K: *)
∀(V: *)
∀(size: #U60)
∀(key: K)
∀(val: V)
∀(lft: (BBT K V))
∀(rgt: (BBT K V))
(BBT K V)
= λK λV λsize λkey λval λlft λrgt
use P = λx ∀(key: K) ∀(val: V) ∀(lft: (BBT K V)) (BBT K V)
use bin = λ_size λrgt.key λrgt.val λrgt.lft λrgt.rgt λkey λval λlft
use b = (BBT.new_node K V key val lft rgt.lft)
use a = (BBT.new_node K V rgt.key rgt.val b rgt.rgt)
a
use tip = λkey λval λlft
(BBT.bin K V size key val lft (BBT.tip K V))
(~rgt P bin tip key val lft)