-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
3,269 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ ftp.flybase.net/** | |
venv/ | ||
src/canary-*/ | ||
.* | ||
*.answers | ||
*.qlf | ||
*.datalog | ||
*-wam.vpw?* | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!(1 (empty) 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
(: sequential (-> Expression %Undefined%)) | ||
(= (sequential $1) (superpose $1)) | ||
|
||
; Used to work | ||
;!(assertEqualToResult | ||
; (sequential | ||
; ( (add-atom &self (man mortal)) | ||
; (match &self ($A mortal) (mortal $A)))) | ||
; ((mortal man))) | ||
|
||
!(sequential | ||
( (add-atom &self (man mortal)) | ||
(match &self ($A mortal) (mortal $A)))) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(: 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)) | ||
|
||
|
||
!(If (or (and True False) True) 1 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
!(collapse (1 2 3)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(: If (-> Bool Atom Atom Atom)) | ||
(= (If $cond $then $else) (if $cond $then $else)) | ||
|
||
(= (facF $n) | ||
(If (== $n 0) | ||
1 | ||
(* $n (facF (- $n 1))))) | ||
|
||
(= (facf $n) | ||
(if (== $n 0) | ||
1 | ||
(* $n (facf (- $n 1))))) | ||
|
||
|
||
!(facF 10) | ||
|
||
!(facf 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(: 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)))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(= (f $x) (* $x $x)) | ||
|
||
!(f 1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(: If (-> Bool Atom Atom Atom)) | ||
(= (If $cond $then $else) (if $cond $then $else)) | ||
|
||
!(If (> 1 2) (3 4) (5 6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(: 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)) | ||
|
||
(= (f $x) 42) | ||
|
||
!(let $y (superpose (3 4 5)) | ||
(If (> $y 3) | ||
(case (1 $y) | ||
(((1 3) (f 0)) | ||
((1 4) (42 42)) | ||
($else (1 1)))))) | ||
|
||
!(assertEqualToResult | ||
(let $y (superpose (3 4 5)) | ||
(If (> $y 3) | ||
(case (1 $y) (((1 3) (f 0)) | ||
((1 4) (42 42)) | ||
($else (1 1)))))) | ||
((42 42) (1 1))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(= (wuza $x) | ||
(let* (($y (* 2 $x)) | ||
($z (superpose (4 5)))) | ||
($y $z))) | ||
|
||
!(wuza 5) | ||
|
||
!(assertEqual | ||
(wuza 5) | ||
(superpose ((10 4) (10 5)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(= (wuzaL $x $L) | ||
(let* (($y (* 2 $x)) | ||
($z (superpose $L))) | ||
($y $z))) | ||
|
||
|
||
!(assertEqual | ||
(wuzaL 2 (3 4)) | ||
(superpose ((4 3)(4 4)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
!(let $T (1.0 0.9) | ||
(let* ((($f1 $c1) $T)) | ||
($f1 $c1))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(= (f $x) (* 2 $x)) | ||
|
||
!(match &self (= (f $x) $y) $y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
!(bind! &attentional_focus (new-space)) | ||
!(add-atom &attentional_focus 1) | ||
!(bind! &concepts (new-space)) | ||
!(add-atom &concepts 2) | ||
|
||
;; check they are added | ||
!(assertEqualToResult | ||
(match &attentional_focus $1 $1) | ||
(1)) | ||
|
||
!(assertEqualToResult | ||
(match &concepts $1 $1) | ||
(2)) | ||
|
||
;; check superposing spaces | ||
!(assertEqualToResult | ||
(match (superpose (&attentional_focus &concepts)) $1 $1) | ||
(1 2)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
!(bind! &belief_events (new-space)) | ||
!(bind! &goal_events (new-space)) | ||
!(match &belief_events $1 $1) | ||
!(add-atom &belief_events belief1) | ||
!(match &belief_events $1 $1) | ||
!(case belief1 | ||
((%void% 42 | ||
))) | ||
!(case (match &belief_events $1 $1) | ||
((%void% 42 | ||
))) | ||
!(assertEqualToResult (case (match &belief_events $1 $1) | ||
((belief1 yes) (%void% 42 | ||
))) (yes)) | ||
!(assertEqualToResult (case (match &goal_events $1 $1) | ||
((%void% 42 | ||
))) (42)) | ||
!(assertEqualToResult (case (match &goal_events $1 $1) | ||
((goal1 yes) | ||
(%void% | ||
42))) (42)) | ||
!(add-atom &goal_events goal1) | ||
!(assertEqualToResult (case (match &goal_events $1 $1) | ||
((goal1 yes) (%void% | ||
42))) (yes)) | ||
!(assertEqualToResult (case (match &goal_events $1 $1) (( | ||
%void% 42 | ||
))) ()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(= (g $x) $x) | ||
(= (g $x) (* 2 $x)) | ||
(= (g test ($y $z)) (* (* 1 $y) $z)) | ||
(= (g 3 ($y $z)) (* $y $z)) | ||
(= (g $x ($y $z)) (* (* $x $y) 42)) | ||
(= (g $x ($y $z)) (* (* 42 $x) $y)) | ||
(= (g a ($y w)) $y) | ||
|
||
!(g 42 (1 2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(= (Truth_Deduction ($f1 $c1) ($f2 $c2)) | ||
((* $f1 $f2) (* (* $f1 $f2) (* $c1 $c2)))) | ||
|
||
!(Truth_Deduction (1.0 0.9) (1.0 0.9)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(= (Add $x Z) $x) | ||
(= (Add $x (S $y)) (Add (S $x) $y)) | ||
|
||
!(Add (S (S Z)) (S (S (S Z)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(: sequential (-> Expression %Undefined%)) | ||
(= (sequential $1) (superpose $1)) | ||
|
||
(: do (-> Expression %Undefined%)) | ||
(= (do $1) (case $1 ())) | ||
|
||
|
||
|
||
!(bind! &var (new-state 1)) | ||
(= (increment) | ||
(superpose ((do (change-state! &var (+ 1 (get-state &var)))) | ||
(get-state &var)))) | ||
|
||
!(sequential ((increment) (increment))) | ||
!(sequential ((increment) (increment) (increment))) | ||
!(sequential ((sequential ((increment) (increment) (increment))))) | ||
!(sequential ((sequential ((increment) (increment) (increment))) (sequential ((increment) (increment) (increment))))) | ||
!(sequential ((sequential ((increment) (increment) (increment))) (increment) (increment) (increment))) | ||
!(do (sequential ((sequential ((increment) (increment) (increment))) (increment) (increment) (increment)))) | ||
!(get-state &var) | ||
!(sequential ((increment))) | ||
!(increment) | ||
!(get-state &var) | ||
!(sequential ((change-state! &var (+ 1 (get-state &var))))) | ||
!(get-state &var) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!(bind! &FIFO (new-state 42)) | ||
!(bind! &WU (new-space)) | ||
!(change-state! &FIFO 45) | ||
!(get-state &FIFO) | ||
!(add-atom &WU a) | ||
!(match &WU $1 $1) | ||
!(add-atom &WU b) | ||
!(remove-atom &WU a) | ||
|
||
!(assertEqual | ||
(match &WU $1 $1) | ||
(get-atoms &WU)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
|
||
(: If (-> Bool Atom Atom Atom)) | ||
(= (If $cond $then $else) (if $cond $then $else)) | ||
|
||
; (: TupleConcat (-> Any Any AnyRet)) | ||
|
||
(= (TupleConcat $Ev1 $Ev2) | ||
(let ($V1 $V2) ($Ev1 $Ev2) | ||
(collapse (superpose ((superpose $V1) (superpose $V2)))))) | ||
|
||
!(TupleConcat (a b c) (e f g)) | ||
!(TupleConcat () (e f g)) | ||
!(TupleConcat (a b c) ()) | ||
|
||
(= (range $K $N) | ||
(If (< $K $N) | ||
(TupleConcat ($K) (range (+ $K 1) $N)) | ||
())) | ||
|
||
!(TupleConcat (a b c) (range 1 1)) | ||
|
||
(unused | ||
(pragma! trace-on-exec False) | ||
(pragma! trace-on-eval False) | ||
(pragma! trace-length 1090) | ||
(pragma! stack-max 100)) | ||
|
||
|
||
!(range 1 1) | ||
|
||
!(range 1 3) | ||
|
||
!(range 2 6) | ||
|
||
!(range 1 10) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
!(superpose (a b c)) | ||
!(superpose ((superpose (a b c)))) | ||
!(superpose ((superpose (a b c)) (superpose (x y z)))) | ||
!(superpose ((superpose (a b c)) x y z )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(: f (-> Number Number)) | ||
(= (f $x) $x) | ||
|
||
!(f 42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(: Cat Atom) | ||
(: Lion Cat) | ||
|
||
(: reproduce (-> Lion Lion Lion)) | ||
(= (reproduce $x $y) childlion) | ||
|
||
(: lion1 Lion) | ||
(: lion2 Lion) | ||
!(get-type lion1) | ||
|
||
!(reproduce lion1 lion2) | ||
|
||
!(get-type Lion) | ||
!(match &self (: Lion $1) $1) | ||
!(match &self (: reproduce $1) $1) |
Oops, something went wrong.