Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is just a little follow-up note to those who wondered what ever happened to my work with AI in Perl. This is part of it. (And it's cross-posted from my use.perl journal.) OK, I finally got off my butt and checked Language::Prolog::Yaswi. The docs need some work and it helps if you know Prolog, and if you use a 5.1 or 5.2 version SWI-Prolog (compiled with thread support: ./configure --enable-mt) and a version of Perl compiled with ithreads. However, if you jump through all of those hoops, you can figure out Who's a thief?.
In short, I finally admitted defeat and have stopped trying to do predicate logic in pure Perl. Implementing a predicate logic engine in pure Perl that is easy to use and extensible involves understanding streams, patterns, a pattern matcher and generating arbitrary streams from complex data structure and handling unification without the benefit of tail call recursion optimizations. In short, to fully enjoy the First Order Predicate Calculus in pure Perl involves writing an NFA regex engine that operates on data structures instead of strings. I am not that smart. I went ahead and used the SWI-Prolog version. And it works :)
Regrettably, this does not work with the latest version of SWI-Prolog, so be warned. I just emailed the author and hope to hear back soon on whether or not he plans an update. Cheers, New address of my CGI Course. In reply to Who's a thief? -- the follow up by Ovid
|
|