users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gprolog display incorrectly a ?


From: Paulo Moura
Subject: Re: gprolog display incorrectly a ?
Date: Mon, 14 Feb 2005 19:07:05 +0000


On 14/fev/2005, at 17:45, Michel Levy wrote:

Let's suppose that the predicate a is defined by
a(f(b),1).
a(f(c),2).
We execute the query
?- a(f(b),X).
X = 1?
Why Prolog display a ? although there are no remaining alternatives ?

Most Prolog compilers, including GNU Prolog, use first-argument indexing when compiling predicate clauses in order to speed-up query execution. This indexing mechanism (which usually is implemented using a hash table) can only help detecting query determinism based on the first argument.

Cheers,

Paulo


-----------------------------------------------------------
Paulo Jorge Lopes de Moura
Dep. of Informatics                   Office 4.3  Ext. 3257
University of Beira Interior          Phone: +351 275319700
6201-001 Covilhã                      Fax:   +351 275319891
Portugal

<mailto:address@hidden>
<http://www.di.ubi.pt/~pmoura>     <http://www.logtalk.org>
-----------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]