From bcb7a1156252da6cd16b7d3505e3f5b686a5669f Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sat, 14 Feb 2026 22:46:03 +1300 Subject: Changed Scheme benchmark tests to need manual code copy/paste from miniKanren for better performance comparisons --- scheme/houses.scm | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'scheme/houses.scm') diff --git a/scheme/houses.scm b/scheme/houses.scm index 8178bf5..40dadc5 100644 --- a/scheme/houses.scm +++ b/scheme/houses.scm @@ -2,6 +2,16 @@ ; Equivalent to example/houses.adb + +; Place contents of mk.scm from simple-miniKanren here. +; An equivalent microKanren implementation such as from the 2013 paper will also work. + + +; Place contents of mkdefs.scm from simple-miniKanren here. +; Be sure to leave out the (load "mk.scm") line. + + + (define (value bin) (cond ((null? bin) 0) @@ -64,21 +74,21 @@ (fail))) -(define (run-houses args) - (let* - ((s (run 1 (h) - (fresh (s t u v w x y z) - (== h `(,s ,t ,u ,v ,w ,x ,y ,z)) - (houses s t u v w x y z)))) - (r (car s))) - (begin - (display (string-append "Allison: " (number->string (value (list-ref r 0))))) (newline) - (display (string-append "Adrienne: " (number->string (value (list-ref r 1))))) (newline) - (display (string-append "Belinda: " (number->string (value (list-ref r 2))))) (newline) - (display (string-append "Benito: " (number->string (value (list-ref r 3))))) (newline) - (display (string-append "Cheri: " (number->string (value (list-ref r 4))))) (newline) - (display (string-append "Crawford: " (number->string (value (list-ref r 5))))) (newline) - (display (string-append "Daryl: " (number->string (value (list-ref r 6))))) (newline) - (display (string-append "Don: " (number->string (value (list-ref r 7))))) (newline)))) +; Main program +(let* + ((s (run 1 (h) + (fresh (s t u v w x y z) + (== h `(,s ,t ,u ,v ,w ,x ,y ,z)) + (houses s t u v w x y z)))) + (r (car s))) + (begin + (display (string-append "Allison: " (number->string (value (list-ref r 0))))) (newline) + (display (string-append "Adrienne: " (number->string (value (list-ref r 1))))) (newline) + (display (string-append "Belinda: " (number->string (value (list-ref r 2))))) (newline) + (display (string-append "Benito: " (number->string (value (list-ref r 3))))) (newline) + (display (string-append "Cheri: " (number->string (value (list-ref r 4))))) (newline) + (display (string-append "Crawford: " (number->string (value (list-ref r 5))))) (newline) + (display (string-append "Daryl: " (number->string (value (list-ref r 6))))) (newline) + (display (string-append "Don: " (number->string (value (list-ref r 7))))) (newline))) -- cgit