Dynamic rules are used widely in Stratego programming and for other problems than originally envisioned. The implementation was extended
with operations for saving and restoring tables, intersection different tables, and rules producing a set (list) of results. It is
time that the whole implementation of dynamic rules is redesigned to
accomodate all these features in a clean manner.

Requirements:

  • necessary operations:
  • add rule
  • lookup rule
  • remove rule
  • extend rule
  • new scope
  • end scope
  • label scope
  • indicate scope of rule using label
  • save ruleset
  • restore ruleset
  • intersection / union / … of rulesets
  • change set (to delay changes to rule table)
  • all operations should be efficient in time and space

  • no cloning of entire table for save/restore
  • add, lookup, remove should be O(1) or O(s), where
    s is the number of enclosing scopes
  • entering/exiting scope should be O(1)
  • saving and restoring should be O(1)
  • intersection … should be O(n) (n number of rules)* extensions
  • ‘extend’ rules (bagof)
  • ‘labels’ to indicate scope (instead of override)
Submitted on 6 April 2004 at 17:34

On 6 April 2004 at 17:40 Jira commented:

STR-44, visser:
Scopes and Undefine will probably disappear


On 6 April 2004 at 17:42 Jira commented:

STR-44, visser:
This will not be done; only the rules that are visible
in the top scope will be visible; otherwise the scope mechanism has no use.


On 7 May 2004 at 17:06 Jira commented:

STR-44, adam:
Ongoing issue, but as it is right now, it’s ready for 0.10!

Log in to post comments