7.10 Tabling restraints: bounded rationality and tripwires
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Tabled execution (SLG resolution)
        • Tabling restraints: bounded rationality and tripwires
          • tripwire/2
          • size_abstract_term/3
          • radial_restraint/0
          • Restraint subgoal size
          • Restraint answer size
          • Restraint answer count
    • Packages
Availability:built-in
[det]size_abstract_term(+Size, +Term, -Abstract)
The size of a term is defined as the number of compound subterms (function symbols) that appear in term. Abstract is an abstract copy of Term where each argument is abstracted by copying only the first Size function symbols and constants. Excess function symbols are replaced by fresh variables.

This predicate is a helper for tabling where Term is the ret/N answer skeleton that is added to the answer table. Examples:

Size Term Abstract
0ret(f(x), a)ret(_, a)
1ret(f(x), a)ret(f(x), a)
1ret(f(A), a)ret(f(A), a)
1ret(f(x), x(y(Z)))ret(f(x), x(_))