purplecat: Hand Drawn picture of a Toy Cat (Default)
100 Current Papers in Artificial Intelligence, Automated Reasoning and Agent Programming. Number 2

Jacob M. Howe and Andy King, A Pearl on SAT and SMT Solving in Prolog, Theoretical Computer Science Volume 435, 1 June 2012, Pages 43–55.
DOI: http://dx.doi.org/10.1016/j.bbr.2011.03.031
Open Access: Available from Kent School of Computing Publication Index: http://www.cs.kent.ac.uk/pubs/2012/3136/index.html

I'm not sure quite how the terminology of a programming pearl arose. It denotes a neat, elegant or otherwise illuminating solution to some programming problem. In this case the programming pearl shows how a solver for a certain sort of logic can be programmed up in only 22 lines of of the Prolog Programming language.

Details under the Cut )
purplecat: Hand Drawn picture of a Toy Cat (agents)
People are always telling me that my usual languages, like Prolog, are silly or, at the very least, impractical, but Java has just got me flummoxed.

I have a list (of logical formulae as it happens) and I want to know if my agent believes everything in the list. To complicate matters the the list can contain variables so the agent might believe them in different ways. So my list might be - do I believe there is something, x say, such that 1) x is blue and 2) x has four legs and the answer might be "blue cow is blue and blue cow has four legs"* but I might also believe that the sky is blue and any number of other things are blue. The object is to find something that I believe is blue and which I also believe has four legs.

This is incredibly easy in Prolog. I just go through the list of formulae one at a time creating a candidate answer, if the answer fails at any point then the programming language automatically back tracks up the list looking for alternatives.

Java doesn't do back tracking. I'm going to have to do something complicated involving keeping track of where I am in the list and which of the alternative candidates I have explored and then zipping back and forth in a sensible fashion. I've appealed to B. who is supposed to be a bit of a dab hand with imperative languages and he looked a bit blank and then started talking about custom iterators.

* with apologies to those of you don't watch CBeebies.


purplecat: Hand Drawn picture of a Toy Cat (Default)

October 2017

123456 7
8910111213 14
151617181920 21


RSS Atom


Style Credit

Expand Cut Tags

No cut tags