Prolog programming language and proof trees -
Prolog programming language and proof trees -
recall 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 3rd rule of interpreter altered, while other rules of interpreter unchanged, follows:
% signature: solve(exp, proof)/2 solve(true, true). solve([], []). solve([a|b], [proofa|proofb]) :- solve(b, proofb), %3 solve(a, proofa). solve(a, node(a, proof)) :- rule(a, b), solve(b, proof).
consider proof tree created query in both versions. can variable substitution achieved in 1 version only? explain. can true leaf move other side of left infinite branch? explain. in both questions give illustration if reply positive. how influence on proof?
please help me ! tx
(i have lot of reservations against meta-interpreter. first reply question had)
in meta-interpreter reifying (~ implementing) conjunction. , implement prolog's conjunction. have 2 different versions how interpret conjunction. 1 time prove first, b. opposite.
think of
p :- p, false.
and
p :- false, p.
the sec version produce finite failure branch, whereas first produce infinite failure branch. effect of using 1 or other meta-interpreter. note "error" might 1 time again mitigated interpreting meta-interpreter itself!
see this answer might clarify notions bit.
there other ways implement conjunction (via binarization) ; such next level of meta-interpreter no longer able compensate.
finally comment on style of meta-interpreter: mixing lists , other terms. in fact [true|true]
true. avoid such representation means. either stick traditional "vanilla" representation operates on syntax tree of prolog rules. is, conjunction represented (',')/2
. or stick lists. not mix lists , other representations.
prolog
Comments
Post a Comment