Article View: comp.lang.prolog
Article #2649Re: cut for meta-interpreter
From: MorrisseyKA
Date: Mon, 20 Apr 1987 21:17
Date: Mon, 20 Apr 1987 21:17
21 lines
1203 bytes
1203 bytes
In article <6681@bu-cs.BU.EDU>, raf@bu-cs.UUCP writes: > Does anybody know how to implement PROLOG meta-circular interpreter > with cut without using ancestor cut? Is there a clean way to implement > (both at PROLOG level and at meta-interpreter level) ancestor cut? One solution is: execute(true) :- !. execute((P,Q)) :- !, execute(P), execute(Q). execute(P) :- clause((P:-Q)), execute(Q). execute(P) :- P. It is attributed to Pereira (don't know which one) and can be found on page 157 of: HOW TO SOLVE IT WITH PROLOG 4th edition by H. Coelho, J. Cotta, and L. Pereira Lisbon, 1985 Karen A. Morrissey
Technical Details
Message-ID:
<1861@druhi.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!ames!ptsfa!ihnp4!drutx!druhi!kamReferences:
<6681@bu-cs.BU.EDU>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!ames!ptsfa!ihnp4!drutx!druhi!kam From: kam@druhi.UUCP (MorrisseyKA) Newsgroups: comp.lang.prolog Subject: Re: cut for meta-interpreter Message-ID: <1861@druhi.UUCP> Date: Mon, 20-Apr-87 16:17:54 EST Article-I.D.: druhi.1861 Posted: Mon Apr 20 16:17:54 1987 Date-Received: Thu, 23-Apr-87 03:29:05 EST References: <6681@bu-cs.BU.EDU> Organization: AT&T Information System Labs, Denver, Co Lines: 21 Keywords: cut,ancestor cut,meta-interperter Summary: a solution