Suppose I have a predicate:
where_tok_child_tok_child(TokTest, % Predicate, TokTest(tokchild)
A, AChildMatched, A_, AChildMatched_) :-
tok_child(A, AChildMatched), % ndet, member(AChildMatched, A's children)
call(TokTest, AChildMatched),
...
?- where_tok_child_tok_child([Tok]>>tok_attr(Tok, pos, noun),
A, AChildMatched,
A_, AChildMatched_).
Is it possible to implement where_tok_child_tok_child
such that it expects a term as its first parameter that must contain Tok as a named Variable? In which case it could more simply be used as:
where_tok_child_tok_child(
tok_attr(Tok, pos, noun), % match_child expects Tok as a variable.
A, AChildMatched,
A_, AChildMatched_)
For this particular example it would also let me simplify the interface as:
where_tok_child_tok_child(
tok_attr(Tok, pos, noun), % match_child expected Tok as a variable.
A, Tok,
A_, Tok_)
Perhaps its the case that frame boundaries prohibit this, though, perhaps there’s another way to supply variables with names to a new frame?