💾 Archived View for siiky.srht.site › wiki › logic-programming.gmi captured on 2023-03-20 at 18:12:22. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
siiky
2023/02/28
2023/03/12
2023/03/12
programming,logic
gemini://gemi.dev/cgi-bin/wp.cgi/view/en?Logic_programming
There are a few logical programming eggs.
In particular there's tiny-prolog, originally written by Nils M Holm. It's pretty basic but also really tiny.
https://wiki.call-cc.org/eggref/5/tiny-prolog
#;1> (! (age maria 69)) (((age maria 69))) #;2> (! (age tone 80)) (((age tone 80)) ((age maria 69))) #;3> (! (age ze 69)) (((age ze 69)) ((age tone 80)) ((age maria 69))) #;5> (! (male ze)) (((male ze)) ((age ze 69)) ((age tone 80)) ((age maria 69))) #;5> (! (male tone)) (((male tone)) ((male ze)) ((age ze 69)) ((age tone 80)) ((age maria 69))) #;6> (! (female maria)) (((female maria)) ((male tone)) ((male ze)) ((age ze 69)) ((age tone 80)) ((age maria 69))) #;7> (? (female ?who) (age ?who 80)) () #;8> (? (female ?who) (age ?who 69)) (((who . maria))) #;9> (? (?relation maria)) (((relation . female)))
The better known miniKanren is also available!