-
Notifications
You must be signed in to change notification settings - Fork 5
/
hyperpose.metta
37 lines (24 loc) · 971 Bytes
/
hyperpose.metta
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(: If (-> Bool Atom Atom))
(= (If True $then) $then)
(= (If False $then) (let $x 0 (let $x 1 $x)))
(: If (-> Bool Atom Atom Atom))
(= (If $cond $then $else) (if $cond $then $else))
!(assertEqual (hyperpose (1 2)) (superpose (1 2)))
!(assertEqual (hyperpose (1 (If (== 1 2) 1)))
(superpose (1 (If (== 1 2) 1))))
!(assertEqual (hyperpose ((If (== 1 2) 1) 1))
(superpose ((If (== 1 2) 1) 1)))
!(assertEqual (hyperpose (1 2 3))
(superpose (1 2 3)))
!(assertEqual (hyperpose ((If (== 1 2) 1) 2 3))
(superpose ((If (== 1 2) 1) 2 3)))
!(assertEqual (hyperpose (1 (If (== 1 2) 1) 3))
(superpose (1 (If (== 1 2) 1) 3)))
!(assertEqual (hyperpose (1 2 (If (== 1 2) 1)))
(superpose (1 2 (If (== 1 2) 1))))
!(assertEqual (hyperpose (1 (If (== 1 2) 1) (If (== 1 2) 1)))
(superpose (1 (If (== 1 2) 1) (If (== 1 2) 1))))
!(assertEqual (hyperpose (1 2 3 4))
(superpose (1 2 3 4)))
!(assertEqual (hyperpose ((1 2) (3 4)))
(superpose ((1 2) (3 4))))