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

7.10.1 Restraint subgoal size

Using the subgoal_abstract(Size) attribute, a tabled subgoal that that is too large is abstracted by replacing compound subterms of the goal with variables. In a nutshell, a goal p(s(s(s(s(s(0)))))) is converted into the semantically equivalent subgoal if the subgoal size is limited to 3.

    ...,
    p(s(s(s(X)))), X = s(s(0)),
    ...,

As a result of this, terms stored in the variant trie that maps goal variants into answer tables is limited. Note that does not limit the number of answer tables as atomic values are never abstracted and there are, for example, an infinite number of integers. Note that restraining the subgoal size does not affect the semantics, provided more general queries on the predicate include all answers that more specific queries do. See also call substitution as described in section 7.5. In addition to the tripwire actions, the max_table_subgoal_size_action can be set to the value abstract:

abstract
Abstract the goal as described above and provide correctness by adding the required unification instructions after the goal.