I have a proof(meta-interpreter) in prolog :
solvept(true,true):- !.
solvept((A,B),(ProofA,ProofB)):-
!, solvept(A,ProofA), solvept(B,ProofB).
solvept(A,(A:-Proof)):-
clause(A,B), solvept(B,Proof).
with this KB :
son(aa,bb).
son(bb,cc).
son(rr,tt).
OK, now I want count the number of ground facts. Who can help me?
Some hints: the
clause/2
standard predicate returns the atomtrue
in its second argument for facts. There's also aground/1
standard predicate that allows you to test if a term is ground. Finally, you need some extra arguments to actually count the number of ground facts used during a proof. This number is initially zero and it's incremented every time you use a ground fact. Try to use an accumulator to implement the counting. Consider reporting back your implementation attempts.