From dbc1f850442139b55bb3c5dfce5e5e4a9e2c1c4e Mon Sep 17 00:00:00 2001 From: Elijah Cohen Date: Wed, 18 Dec 2024 15:16:35 -0600 Subject: [PATCH] abstraction upon recursion achieved --- demos.kl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/demos.kl b/demos.kl index 31c455e..dfe9635 100644 --- a/demos.kl +++ b/demos.kl @@ -57,7 +57,6 @@ (def abstract-generator (Z (B (B (B (B (C (C C nil))))) (B (Phi B (B S (B cons))) (B (B W) (B (B B))))))) -(def intermediary (Z (C (B B (B B (B C (B (B S) (B C (C (C Phi cdr) car)))))) (C (B (B B (Phi cons)) (C (C Phi car) cdr)) (C B cdr))))) -(def withcons (B (B (B Z)) intermediary)) +(def tr-fac (B (S (Phi (eq 0) cdr car)) (C B (Phi cons (Phi * car cdr) (B (C - 1) cdr))))) -(def tr-fac (B (S (Phi (eq 0) cdr car)) (C B (Phi cons (Phi * car cdr) (B (C - 1) cdr))))) \ No newline at end of file +(def abstract-rec (B (B (B (C B cons))) (B (B (B B)) (B (B (B Z)) (C (B B (B B (B B (B S (C (C Phi cdr) car))))) (B (B (C B)) (B (C B (C B cdr)) (B (Phi cons) (C (C Phi car) cdr))))))))) \ No newline at end of file -- 2.39.2