This repo is not current. Development has moved from Hg to Git. For the latest code use the "Source Code" tab above to go to the "Thun" git repo or navigate to:
https://osdn.net/projects/joypy/scm/git/Thun
Revision | e572abf9735ffb6759158ada559c8bc059d53ab9 (tree) |
---|---|
Time | 2019-05-04 22:57:14 |
Author | Simon Forman <sforman@hush...> |
Commiter | Simon Forman |
Change name from alpha to tmi.
@@ -1,19 +1,19 @@ | ||
1 | 1 | % A Tracing Meta-Interpreter for Thun |
2 | 2 | |
3 | -alpha(true). | |
4 | -alpha((A, B)) :- alpha(A), alpha(B). | |
5 | -alpha(number(A)) :- !, number(A). | |
6 | -alpha(var(A)) :- !, var(A). | |
7 | -alpha(!) :- !. | |
3 | +tmi(true). | |
4 | +tmi((A, B)) :- tmi(A), tmi(B). | |
5 | +tmi(number(A)) :- !, number(A). | |
6 | +tmi(var(A)) :- !, var(A). | |
7 | +tmi(!) :- !. | |
8 | 8 | |
9 | 9 | % Meta-logical print trace. |
10 | 10 | % (Could also be captured in a list or something instead.) |
11 | -alpha(thun(E, Si, _)) :- portray_clause(Si-E), fail. | |
11 | +tmi(thun(E, Si, _)) :- portray_clause(Si-E), fail. | |
12 | 12 | |
13 | -alpha(Goal) :- | |
13 | +tmi(Goal) :- | |
14 | 14 | checky(Goal), |
15 | 15 | clause(Goal, Body), % doesn't work for e.g. + |
16 | - alpha(Body). | |
16 | + tmi(Body). | |
17 | 17 | |
18 | 18 | checky(Goal) :- |
19 | 19 | Goal \= true, |
@@ -24,7 +24,7 @@ | ||
24 | 24 | |
25 | 25 | /* |
26 | 26 | |
27 | -[debug] ?- alpha(thun([1, 2, swap], Si, So)). | |
27 | +[debug] ?- tmi(thun([1, 2, swap], Si, So)). | |
28 | 28 | _-[1, 2, swap]. |
29 | 29 | [1|_]-[2, swap]. |
30 | 30 | [2, 1|_]-[swap]. |
@@ -32,7 +32,7 @@ | ||
32 | 32 | So = [1, 2|Si] ; |
33 | 33 | false. |
34 | 34 | |
35 | -[debug] ?- alpha(thun([[1], 2, swons], Si, So)). | |
35 | +[debug] ?- tmi(thun([[1], 2, swons], Si, So)). | |
36 | 36 | _-[[1], 2, swons]. |
37 | 37 | [[1]|_]-[2, swons]. |
38 | 38 | [2, [1]|_]-[swons]. |
@@ -41,7 +41,7 @@ | ||
41 | 41 | [[2, 1]|_]-[]. |
42 | 42 | So = [[2, 1]|Si] . |
43 | 43 | |
44 | -[debug] ?- alpha(thun([[1], 2, [swons], i], Si, So)). | |
44 | +[debug] ?- tmi(thun([[1], 2, [swons], i], Si, So)). | |
45 | 45 | _-[[1], 2, [swons], i]. |
46 | 46 | [[1]|_]-[2, [swons], i]. |
47 | 47 | [2, [1]|_]-[[swons], i]. |