On Tue, Aug 18, 2015 at 5:15 PM, "Michał Bieliński" <mic...@kast.net.pl> wrote:
> Dnia 8 Sierpnia 2015, 13:59, So, Donald Winiecki napisał: > > I have a question about exercise 2.2 in LPN!. > > > > In particular, it appears to be the case that GProlog returns different > > results than does SWI-Prolog on question 5 in exercise 2.2. > > The heart of the problem is the clause: > magic(X) :- wizard(X). > > In the program code predicate wizard is referenced but defined nowhere. > > > I understand SWI-Prolog's results, but don't understand why GProlog > > stops when it hits the rule "magic(X):- wizard(X)." Any pointers > > are terrifically appreciated! > > I have the opposite problem! I understand GNU Prolog's approach but fail > to grasp why SWI does not signal missing definitions by default. :-p > Indeed. I was hoping my question would be forgotten, even though I have been building courage to report that the problem was, as they say, `the loose nut on my keyboard`. Both SWI-Prolog and GProlog were behaving properly and identically (though reporting the missing definition in their own ways). The problems were all mine. Very basic Prolog syntax was being munged by myself, and misinterpreted on top of it all. I've been spending a lot of time in Common Lisp the last few weeks but endeavour to get back here soon. > > Anyway, how the solver behaves when it hits nonexistent procedure is > configurable. Use set_prolog_flag(unknown, X) where X can be 'error', > 'fail' or 'warning' to change it. > > -- > Michał Best, _don
_______________________________________________ Users-prolog mailing list Users-prolog@gnu.org https://lists.gnu.org/mailman/listinfo/users-prolog