[Top][All Lists]

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

Re: interpreted prolog

From: cvb
Subject: Re: interpreted prolog
Date: Sat, 08 Sep 2001 23:48:00 -0400

Christer Johansson wrote:
while I thought that a query like : xerox(tantric, meditation). should
just fail - the gprolog compiler gives an 'existence error'.
That is what most prolog machines do, e.g.,
aisun1[Sun Sep  9 00:10:23 EDT 2001]bancroft prolog
Quintus Prolog Release 3.3 (Sun 4, SunOS 5.5.1)
Originally developed by Quintus Corporation, USA.
Copyright (C) 1996, AI International Ltd.  All rights reserved.
Castle Chambers, High Street, Berkhamsted, Herts, UK. +44 (0)1442 873873
Email: address@hidden    WWW:
Licensed to Artificial Intelligence Center University of Georgia

| ?- xerox(tantric, meditation).
! Existence error in xerox/2
! procedure user:xerox/2 does not exist
! goal:  xerox(tantric,meditation)

| ?- halt.
aisun1[Sun Sep  9 00:10:23 EDT 2001]bancroft sicstus
SICStus 3.8.5 (sparc-solaris-5.7): Fri Oct 27 10:12:22 MET DST 2000
Licensed to
| ?- xerox(tantric, meditation).
{EXISTENCE ERROR: xerox(tantric,meditation): procedure user:xerox/2 does not exist}

Is there a way around this - a way to run prolog in interpreted prolog? Some way to turn off the existence errors?
To do so may be making a sort of meta "closed world" assumption, claiming "unknown predicates are false."

Given a set of literal facts from, such that,

| ?- [xerox].
compiling /usr/home/bancroft/src/prolog/gpvn/ for byte code...
/usr/home/bancroft/src/prolog/gpvn/ compiled, 5 lines read - 530 bytes written, 33 ms

(10 ms) yes
| ?- listing.

xerox(zen, meditation).
xerox(hatha, yoga).
xerox(kundalini, yoga).

| ?- xerox(tantric, meditation).
xerox(tantric, meditation).

| ?-

One can tell that the predicate as defined does not contain the desired literal.  This is slightly different than not having a definition for the predicate!

In any case, the following may be what you are asking for,

main :-
  format( "] ?- ", [] ),
Was this a homework question ?


reply via email to

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