Pattern Abstract Grammar

Pattern Abstract Grammar

Structured Instructions for AI Systems

BNF Grammar

PAG is defined by a formal Context-Free Grammar (CFG) expressed in BNF notation. The complete grammar is organized into five rule categories.

Planning Rulesα

Grammar for document structure, phases, validation gates, and meta information.

Statement Rulesβ

Grammar for directives, actions, control flow, and declarations.

Expression Rulesγ

Grammar for expressions, operators, literals, and lexical elements.

Coordination Rulesδ

Grammar for async operations, state machines, DAGs, and tool invocations.

Flowchart Rulesε

Grammar for visual flow definitions in various formats.