🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3655

!/metacall/metainterpreter

#3655
From: Bart Demoen
Date: Mon, 12 Sep 1988 11:55
29 lines
1142 bytes
This is a reply to article <358@quintus.UUCP>  (R. O'Keefe)
whose author does not understand why the mentioned metainterpreter does not
work for programs containing metacall if ! does cut outside the scope of call/1;
so, I will show it:

first of all, the metainterpreter does not handle builtinpredicates, so
one has to add a rule like:

	prove(Goal) :-
		builtin(Goal) , ! ,
		call(Goal) .

suppose there are two definitions of rule/4:

	rule(a(X),[],0,[call(X)]) .
	rule(a(X),[],0,[write('not cut away')]) .

and execute the query

	?- prove(a(!)) .

the result is the same is for the program

	a(X) :- call(X) .
	a(X) :- write('not cut away') .
	
	and query ?- a(!) .

only if !/0 does NOT cut outside call/1
Technical Details
Message-ID: <1435@kulcs.kulcs.uucp>
Path: arc1-ca.pugleaf.net!utzoo!yunexus!geac!syntron!jtsv16!uunet!mcvax!prlb2!kulcs!bimbart

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!geac!syntron!jtsv16!uunet!mcvax!prlb2!kulcs!bimbart
From: bimbart@kulcs.uucp (Bart Demoen)
Newsgroups: comp.lang.prolog
Subject: !/metacall/metainterpreter
Message-ID: <1435@kulcs.kulcs.uucp>
Date: 12 Sep 88 11:55:25 GMT
Article-I.D.: kulcs.1435
Reply-To: bimbart@kulcs.UUCP (Bart Demoen)
Organization: Katholieke Universiteit Leuven, Dept. Computer Science
Lines: 29