We've been using Prolog in one of my classes this semester. It's pretty neat!
So far, our assignments have been writing evaluators and a super-shitty compiler for Little Languages represented as Prolog lists -- essentially S-expressions.
It's amazing how much one can do with three or four lines of code!
Anyhow, what do you guys think of /b/rolog?
Name:
Anonymous2013-03-14 21:03
Any experts in Prolog and Breadth-First Search want to give any pointers? :(
"breadth_seek(Goal) such that, when invoked with Goal instantiated to a goal node for breadth first search, breadth_seek will invoke breadth_iterate zero or more times, until Goal appears on (i.e. is mapped by) the openlist. If breadth_iterate fails before this happens, breath_seek(Goal) should also fail."
We have a dynamic list for the open and closed lists:
:- dynamic openlist/1, closedlist/1.
we also have a mapped(K, M), where K is the key and M is the list, I.E if K appears in the list M, then the result is Yes, if it isn't, the result is No.
This is my breadth_iterate so far, but I believe it's probably wrong:
breadth_iterate :-
%take the first node off the open list
%expand it (see all nodes within one step)
%change open and closed lists
%splits openlist into head and tail, gets first node
closedlist(Mclosed),
openlist(Mopen),