-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This puts in place a fairly straightforward implementation of the `defunalias` primitive. This is essentially identical to `defalias` except that all symbols are for functions rather than anything else.
- Loading branch information
1 parent
6da83cd
commit bad98c1
Showing
17 changed files
with
187 additions
and
23 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
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
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
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
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,6 @@ | ||
{ "A": [0] } | ||
{ "A": [0,0] } | ||
{ "A": [0,0,0] } | ||
{ "A": [0,0,0,0] } | ||
{ "A": [0,0,0,0,0] } | ||
{ "A": [0,0,0,0,0,0] } |
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 @@ | ||
(defcolumns A) | ||
(defpurefun (id x) x) | ||
(defunalias ID id) | ||
(defconstraint test () (ID 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,5 @@ | ||
{ "A": [1] } | ||
{ "A": [2] } | ||
{ "A": [1,1] } | ||
{ "A": [1,1] } | ||
{ "A": [2,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,15 @@ | ||
{ "A": [], "B": [] } | ||
{ "A": [0], "B": [0] } | ||
{ "A": [1], "B": [1] } | ||
{ "A": [2], "B": [2] } | ||
{ "A": [3], "B": [3] } | ||
{ "A": [4], "B": [4] } | ||
;; | ||
{ "A": [0,0], "B": [0,0] } | ||
{ "A": [1,0], "B": [1,0] } | ||
{ "A": [0,1], "B": [0,1] } | ||
{ "A": [1,1], "B": [1,1] } | ||
;; | ||
{ "A": [125,0], "B": [125,0] } | ||
{ "A": [0,125], "B": [0,125] } | ||
{ "A": [125,125], "B": [125,125] } |
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 @@ | ||
(defcolumns A B) | ||
(defpurefun (eq x y) (- y x)) | ||
(defunalias eq! eq) | ||
(defconstraint test () (eq! A B)) |
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,35 @@ | ||
{ "A": [0], "B": [1] } | ||
{ "A": [1], "B": [0] } | ||
{ "A": [0], "B": [1] } | ||
{ "A": [0], "B": [2] } | ||
{ "A": [0], "B": [3] } | ||
{ "A": [1], "B": [0] } | ||
{ "A": [2], "B": [0] } | ||
{ "A": [3], "B": [0] } | ||
;; | ||
{ "A": [0,0], "B": [0,1] } | ||
{ "A": [1,0], "B": [0,0] } | ||
{ "A": [0,0], "B": [1,0] } | ||
{ "A": [0,1], "B": [0,0] } | ||
{ "A": [0,0], "B": [1,1] } | ||
{ "A": [1,1], "B": [0,0] } | ||
{ "A": [1,0], "B": [0,1] } | ||
{ "A": [0,1], "B": [1,0] } | ||
;; | ||
{ "A": [0,0], "B": [0,125] } | ||
{ "A": [125,0], "B": [0,0] } | ||
{ "A": [0,0], "B": [125,0] } | ||
{ "A": [0,125], "B": [0,0] } | ||
{ "A": [0,0], "B": [125,125] } | ||
{ "A": [125,125], "B": [0,0] } | ||
{ "A": [125,0], "B": [0,125] } | ||
{ "A": [0,125], "B": [125,0] } | ||
;; | ||
{ "A": [65,65], "B": [65,65573234] } | ||
{ "A": [65573234,65], "B": [65,65] } | ||
{ "A": [65,65], "B": [65573234,65] } | ||
{ "A": [65,65573234], "B": [65,65] } | ||
{ "A": [65,65], "B": [65573234,65573234] } | ||
{ "A": [65573234,65573234], "B": [65,65] } | ||
{ "A": [65573234,65], "B": [65,65573234] } | ||
{ "A": [65,65573234], "B": [65573234,65] } |
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,25 @@ | ||
{ "X": [], "Y": [] } | ||
{ "X": [0], "Y": [0] } | ||
{ "X": [1], "Y": [2] } | ||
{ "X": [2], "Y": [4] } | ||
{ "X": [3], "Y": [6] } | ||
;; | ||
{ "X": [0,0], "Y": [0,0] } | ||
{ "X": [0,1], "Y": [0,2] } | ||
{ "X": [0,2], "Y": [0,4] } | ||
{ "X": [0,3], "Y": [0,6] } | ||
;; | ||
{ "X": [1,0], "Y": [2,0] } | ||
{ "X": [1,1], "Y": [2,2] } | ||
{ "X": [1,2], "Y": [2,4] } | ||
{ "X": [1,3], "Y": [2,6] } | ||
;; | ||
{ "X": [2,0], "Y": [4,0] } | ||
{ "X": [2,1], "Y": [4,2] } | ||
{ "X": [2,2], "Y": [4,4] } | ||
{ "X": [2,3], "Y": [4,6] } | ||
;; | ||
{ "X": [3,0], "Y": [6,0] } | ||
{ "X": [3,1], "Y": [6,2] } | ||
{ "X": [3,2], "Y": [6,4] } | ||
{ "X": [3,3], "Y": [6,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,6 @@ | ||
(defcolumns X Y) | ||
(defun (double x) (+ x x)) | ||
(defpurefun (eq x y) (- x y)) | ||
(defunalias times2 double) | ||
;; Y == 2 * X | ||
(defconstraint c1 () (eq Y (times2 X))) |
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 @@ | ||
{ "X": [1], "Y": [0] } | ||
{ "X": [1], "Y": [3] } | ||
{ "X": [2], "Y": [3] } | ||
{ "X": [3], "Y": [5] } | ||
;; | ||
{ "X": [0,1], "Y": [0,0] } | ||
{ "X": [0,0], "Y": [0,2] } | ||
{ "X": [0,3], "Y": [0,4] } | ||
{ "X": [0,2], "Y": [0,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,2 @@ | ||
(defcolumns X) | ||
(defunalias INC X) |
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 @@ | ||
(defconst X 1) | ||
(defunalias INC X) |
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 @@ | ||
(defunalias X 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 @@ | ||
(defunalias X X) |