Article View: comp.lang.prolog
Article #646Quintus' Prolog++ -- Some help needed
From: Keith D'Souza
Date: Mon, 17 Aug 1992 19:19
Date: Mon, 17 Aug 1992 19:19
53 lines
2004 bytes
2004 bytes
Hi!
I have recently begun working with Quintus' PROLOG++
and need help with a problem I am facing.
In the problem I am exploring, I use the predicate
newgraph(X,Y,Z):-
instance <- new(Y,X),
X <- graphtype := Z.
to create a new instance X of the object Y, and assign
the value Z to the attribute 'graphtype' of X.
So, I can create an instance 'vrp1', of an 'instancegraph' object,
and assign the value 'vr' to the 'graphtype' attribute of vrp1.
While this predicate succeeds when called, if I attempt to trace
the call, it returns the following:
call newgraph(vrp1, instancegraph, vr)
UNIFY 1 []
call SEND new(instancegraph, vrp1) FROM prolog TO instance
EXPAND []
exit SEND new(instancegraph, vrp1) FROM prolog TO instance
call SEND graphtype:=vr FROM prolog TO vrp1
EXPAND []
call SEND graphtype:=vr FROM prolog TO vrp1 ONTO instancegraph
UNIFY 2 []
call INHERIT := /2 FOR instancegraph ?
fail INHERIT := /2 FOR instancegraph ?
fail SEND graphtype:=vr FROM prolog TO vrp1 ONTO instancegraph
fail SEND graphtype:=vr FROM prolog TO vrp1
redo SEND new(instancegraph, vrp1) FROM prolog TO instance
fail SEND new(instancegraph, vrp1) FROM prolog TO instance
fail newgraph(vrp1, instancegraph, vr)
I.e., the call fails!
Obviously, the problem originates around the statements
call INHERIT := /2 FOR instancegraph ?
fail INHERIT := /2 FOR instancegraph ?
My problem is, being a novice, I do not know why this happens.
Any help in this matter is appreciated!
Thanx
Keith
dsouza@sfu.ca
Technical Details
Message-ID:
<1992Aug17.191907.14906@sfu.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!van-bc!ubc-cs!newsserver.sfu.ca!dsouzaShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!van-bc!ubc-cs!newsserver.sfu.ca!dsouza From: dsouza@fraser.sfu.ca (Keith D'Souza) Subject: Quintus' Prolog++ -- Some help needed Message-ID: <1992Aug17.191907.14906@sfu.ca> Sender: news@sfu.ca Organization: Simon Fraser University, Burnaby, B.C., Canada Distribution: World Date: Mon, 17 Aug 1992 19:19:07 GMT Lines: 54