Print reduction steps
This commit is contained in:
parent
8b79c3007b
commit
1655160113
|
@ -0,0 +1,13 @@
|
||||||
|
define nil ()
|
||||||
|
define (pair (?x) (?y)) ((?x ?y))
|
||||||
|
define (first (?x ?y)) (?x)
|
||||||
|
define (second (?x ?y)) (?y)
|
||||||
|
|
||||||
|
define (quote ?x) (quote ?x)
|
||||||
|
define (if ?c ?t else ?f) (if/else ?c quote ?t quote ?f)
|
||||||
|
define (if/else (true) quote (?t) quote (?f)) (?t)
|
||||||
|
define (if/else (false) quote (?t) quote (?f)) (?f)
|
||||||
|
|
||||||
|
define (hello) (bye)
|
||||||
|
|
||||||
|
pair (pair (foo) (nil)) (baz)
|
2
modal.py
2
modal.py
|
@ -305,7 +305,7 @@ def run(rules, queue, limit=pow(2, 32)):
|
||||||
result, queue = operation(queue, rules, pattern, *parameters)
|
result, queue = operation(queue, rules, pattern, *parameters)
|
||||||
if result == True:
|
if result == True:
|
||||||
failures = 0
|
failures = 0
|
||||||
#print("<>: ", inspect(seek(queue, ["SRT"])))
|
print("<>: ", inspect(seek(queue, ["SRT"])))
|
||||||
#print("<>: ", inspect(queue))
|
#print("<>: ", inspect(queue))
|
||||||
#input()
|
#input()
|
||||||
steps = steps + 1
|
steps = steps + 1
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
define nil ((0))
|
define nil ((0))
|
||||||
define (cons ?x (?y)) ((?x ?y))
|
define (pair (?x) (?y)) ((?x ?y))
|
||||||
define (car (?x)) ?x
|
define (first (?x ?y)) (?x)
|
||||||
|
define (second (?x ?y)) (?y)
|
||||||
|
define (quote ?x) (quote ?x)
|
||||||
|
|
||||||
|
define test (first pair (A) (pair (B) (pair (C) nil)))
|
Loading…
Reference in New Issue