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…