Questions tagged [prolog-metainterpreter]

Use with Prolog when Prolog code is a meta-interpreter, e.g. a self-interpreter of Prolog code or a meta-circular interpreter of Prolog code.

Prolog meta interpreters are useful to change the evaluation process of Prolog code.

References:

A Couple of Meta-interpreters in Prolog
Three Meta-Interpreters: Prolog in Prolog, EXSHELL, and a Planner (pdf)

32 questions
2
votes
1 answer

Meta-interpreting logical cut in Prolog (Edited to accommodate comments)

I am implementing a geometric theorem prover in Sicstus Prolog; and in order to get over the problem of backtracking over I/O, I am using a meta-interpreter. This last however does not seem to handle cuts as expected. My meta-interpreter looks like…
user10906061
2
votes
0 answers

Execution tree meta interpreting

I have tracing meta-interpreter made from my previous questions here and I would like to make similar meta-interpreter but this time for making execution trees. I've made something like this below using similar to same code found on the web and…
Đrakenus
  • 540
  • 3
  • 20
1
vote
2 answers

committing to choices in the scope of catch/3

The following is small prolog meta-interpreter that interprets the cut using the catch/throw mechanism[1]. fruit(apple). fruit(orange) :- !. fruit(banana). % meta-interpreter that handles the cut prove(true) :- !. prove(!) :- !, ( true ; throw(cut)…
Penelope
  • 291
  • 6
1
vote
1 answer

examples of prolog meta-interpreter uses?

I'm reading several texts and online guides to understand the possibilities of prolog meta-interpreters. The following seem like solid use cases: proof explainers / tracers changing proof search strategy, eg breadth first vs depth first domain…
Penelope
  • 291
  • 6
1
vote
0 answers

handling the cut with a simple meta-interpreter

The following is a simple meta-interpreter, as seen in many guides/textbooks. prove(true) :- !. prove((A,B)):- !, prove(A), prove(B). prove(H) :- clause(H,B), prove(B), write(H), write(" <- "), writeln(B). The following is a simple program to…
Penelope
  • 291
  • 6
1
vote
1 answer

Is it possible to write a prolog interpreter that avoids infinite recursion?

Main features I recently have been looking to make a Prolog meta-interpreter with a certain set of features, but I am starting to see that I don't have the theoretical knowledge to work on it. The features are as follows : Depth-first…
1
vote
1 answer

Arguments are not sufficiently instantiated in clause/2

i'm trying to write a simple meta-interpreter for the unification in prolog, this is what i got so…
Nazgot
  • 412
  • 3
  • 17
1
vote
1 answer

No permission to access private_procedure `var/1'

I have written a simple unification algorithm (with occurs check) in Prolog, using meta-programming techniques. I am using SWI-Prolog 7.4.2. I want to use it inside a meta-interpreter, such as the classic vanilla meta-interpreter: solve(true) :-…
Mattia F.
  • 1,720
  • 11
  • 21
0
votes
1 answer

using throw(cut) and catch() to implement the cut in a meta-interpreter

I have previously asked about implementing the cut in a simple prolog meta-interpreter: handling the cut with a simple meta-interpreter A comment pointed me to using the throw(cut)/catch combination: Implementing cut in tracing meta interpreter…
Penelope
  • 291
  • 6
0
votes
1 answer

negation \+ and vanilla meta-interpreter

The following is the classic "textbook" vanilla meta-interpreter for prolog. % simplest meta-interpreter solve(true) :- !. solve((A,B)):- !, solve(A), solve(B). solve(A) :- clause(A,B), solve(B). The following is simple program which establishes…
Penelope
  • 291
  • 6
0
votes
1 answer

Prolog meta-interpreters and single sided unification

I tried this vanilla interpreter: solve(true) :- !, true. solve(X is E) :- !, X is E. solve((A,B)) :- !, solve(A), solve(B). solve(H) :- clause(H,B), solve(B). Can we use it to meta-interpret some code? I tried this code, requires SWI-Prolog…
user502187
0
votes
1 answer

Infinite loop inference Prolog

An infinite loop is generated when the inferential motor is activated to make the necessary inferences. The rules and facts have been defined according to a specific syntax for the meta-interpreter I am using. The rule is a quintuple in which the…
0
votes
1 answer

how to create Meta-rules and/or meta-interpreter for an Expert System with Swi-Prolog

I wanna create an expert system with meta-interpreter with SWI-Prolog... what is the best and the easier way to make it? which is the procedure to make it?
Jane
  • 1
  • 2
0
votes
1 answer

Prolog programming language and proof trees

Recall this proof meta-circular solve(true, true). solve([], []). solve([A|B],[ProofA|ProofB]) :- solve(A,ProofA), solve(B, ProofB). solve(A, node(A,Proof)) :- rule(A,B), solve(B,Proof). Assume that the third rule of the interpreter…
0
votes
2 answers

meta-Programming Prolog ,List of ground facts

I must generate a list that contains all the ground terms that pass through a meta-programming in Prolog. I did it , but the last element I don't know why is duplicate, here my code : KB: parent(aa,vv). parent(bb,aa).…
user3043636
  • 559
  • 6
  • 23