From ea52d03d9a5e54d67534e911254127df7e5b8f54 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Mon, 9 Nov 2020 03:45:20 +0900 Subject: wip11 --- vikalpa.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vikalpa.scm') diff --git a/vikalpa.scm b/vikalpa.scm index 5a51cfa..49f6477 100644 --- a/vikalpa.scm +++ b/vikalpa.scm @@ -680,7 +680,7 @@ (equal? (cons (car x) (cdr y)) x) '#t) y)) - (define-axiom cons/car+cdr (x y) + (define-axiom cons/car+cdr (x y) (equal? (if (pair? x) (equal? (cons (car x) (cdr y)) x) '#t) @@ -729,7 +729,7 @@ (define-function app (x y) (if (atom? x) y - (cons x (app x y)))) + (cons x (app (cdr x) y)))) (define-theorem associate-app (x y z) (equal? (app (app x y) z) @@ -741,3 +741,6 @@ (size (car x)) (size (cdr x))) 0)) + +(define (atom? x) + (not (pair? x))) -- cgit v1.2.3