Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdragon.UUCP Path: utzoo!watmath!watnot!watdragon!rggoebel From: rggoebel@watdragon.UUCP (Randy Goebel LPAIG) Newsgroups: net.lang.prolog Subject: Re: Standard behavior? Message-ID: <980@watdragon.UUCP> Date: Tue, 13-May-86 12:39:01 EDT Article-I.D.: watdrago.980 Posted: Tue May 13 12:39:01 1986 Date-Received: Wed, 14-May-86 11:20:24 EDT Organization: U of Waterloo, Ontario Lines: 22 > >Consider the following trivial predicate: > >a([]). > >a(_). > > > >Given the query :-a([]). , C-Prolog finds one match and UNSW Prolog finds two. > >Which is standard behavior? How do other implementations behave? _____________ > I do not have the authority to say which is "standard" behavior, if by that > you mean which is found more commonly in implementations. However, any book > on "vanilla" Prolog will tell you that "_" matches to anything, including a > null list, so I would indeed be annoyed by C-Prolog if it did not find two > matches. Anybody disagree? ------------- Hmmm. The reason for logic programming's existence is to dispense with guesses about what behaviour should be. The formulae assert that the individual constant named `[]' and everthing else (i.e., `_') is in the class named by the predicate `a'. If you believe that the anonymous variable is a universially quantified variable, then there are two resolution proofs of the query a([]). Implementors' treatment of `_' can produce non-standard behaviour; non-standard means not consistent with the logical interpretation.