Meta interpreter 7

Description

A meta-interpreter for pure Prolog in continuation style

Source: The Art of Prolog

Download

Program source code: meta_interpreter_7.pl

Listing

/*
  solve(Goal) :-
     Goal is true given the pure Prolog program defined by clause/2.
*/
 
  solve(Goal) :- solve(Goal,[]).
 
     solve([],[]).
     solve([],[G|Goals]) :- solve(G,Goals).
     solve([A|B],Goals) :- append(B,Goals,Goals1),solve(A,Goals1).
     solve(A,Goals) :- rule(A,B), solve(B,Goals).
 
%  Program 17.6  A meta-interpreter for pure Prolog in continuation style

Comments

pl/prolog/pllib/meta_interpreter_7.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0