Re: gprolog display incorrectly a ?
Paulo Moura <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <[email protected]> |
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:[email protected]> <http://www.di.ubi.pt/~pmoura> <http://www.logtalk.org> -----------------------------------------------------------