I have some prolog code like this:
nextA("Terra", "Michelle").
nextA("Terra", "Max").
nextA("Marie", "Claudia").
nextA("Ed", "Larissa").
nextB("Terra", "Tom").
nextB("Tom", "Bob").
nextB("Tom", "Karl").
nextB("Michelle", "Tom").
nextB("Michelle", "Ed").
nextB("Michelle", "Stephane").
cond1(Step, Solution) :-
once(nextA(Step, NextStep)),
relations(NextStep, Solution0),
union([Step], Solution0, Solution).
relations(Step, Solution) :-
cond1(Step, Solution).
relations(Step, Solution) :-
not(cond1(Step, Solution)),
nextB(Step, NextStep),
relations(NextStep, Solution0),
union([Step], Solution0, Solution).
relations(Step, [Step]) :- not(nextA(Step, S)), not(nextB(Step, S)).
If I now want to trace this one in swiprolog debugger with commands
trace(relations).
relations(X,Y).
the output is:
T [10] Call: relations(_28494, _28496)
T [20] Call: relations("Michelle", _29736)
T [29] Call: relations("Tom", _30636)
T [38] Call: relations("Bob", _31536)
T [38] Exit: relations("Bob", ["Bob"])
T [29] Exit: relations("Tom", ["Tom", "Bob"])
T [20] Exit: relations("Michelle", ["Michelle", "Tom", "Bob"])
T [10] Exit: relations("Terra", ["Terra", "Michelle", "Tom", "Bob"])
is there a way (without rewriting the relations predicate) to trace only the first parameter in a way the output is something like that?
T [10] Call: relations(_28494)
T [20] Call: relations("Michelle", ??)
T [29] Call: relations("Tom", ??)
T [38] Call: relations("Bob", ??)
T [38] Exit: relations("Bob", ??)
T [29] Exit: relations("Tom", ??)
T [20] Exit: relations("Michelle", ??)
T [10] Exit: relations("Terra", ??)
is their furthermore some way to force the debugger to write the results in some .txt-file?