Guarded Attribute grammar

Guarded Attribute Grammars (GAG) is a model of cooperative work based on task resolution. A task is solved by dividing it into smaller tasks, solving these sub tasks and combining their results to produce the required output. The decomposition of tasks into smaller tasks is modeled as rewriting rules using the productions of an attribute grammar. The inherited and synthesized attributes of the grammar respectively model the input and output parameters of tasks, while the semantics rules are used to enforce data-flow between a task and its sub tasks, and between sibling tasks. Each task is executed as a co-routine that produces eagerly its output while consuming lazily its input: a piece of information is accessed from its input only when needed and a piece of information is produced in its output as soon as it can be computed. Constraints on the input parameters of tasks are used to restrict the applicability of a rule in a given configuration. These constraints are guards that are evaluated against the effective input values, an operation that filters applicable rules for each pending tasks. Enacting a GAG model is done lazily, that is, a rule is enabled if and when its guard becomes satisfied.

 

Comments are closed.