diff options
| author | Jedidiah Barber <contact@jedbarber.id.au> | 2026-02-14 22:46:03 +1300 |
|---|---|---|
| committer | Jedidiah Barber <contact@jedbarber.id.au> | 2026-02-14 22:46:03 +1300 |
| commit | bcb7a1156252da6cd16b7d3505e3f5b686a5669f (patch) | |
| tree | 6ec75590b6fc71a08fc873430e1a82020e6bc801 /scheme/houses.scm | |
| parent | b23d73cfa76919a726558e51bf0b0f0cc7c1575e (diff) | |
Changed Scheme benchmark tests to need manual code copy/paste from miniKanren for better performance comparisonsHEADmaster
Diffstat (limited to 'scheme/houses.scm')
| -rw-r--r-- | scheme/houses.scm | 42 |
1 files changed, 26 insertions, 16 deletions
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))) |
