Program = { "(" Decl ")" }. Decl = "VAR" {Id} | "RULES" {Rule} | "STRATEGY" StrategyDecl | "GOAL" GoalDecl | "STARTTERM" StarttermDecl. Rule = Term "->" TermDistWithNum | Term "->" TermDistWithProb. TermDist = int ":" term | int ":" term "||" TermDist. TermDistWithProb = prob ":" term | prob ":" term "||" TermDistWithProb. Term = Id. prob = int "/" int. StrategyDecl = INNERMOST. GoalDecl = TERMINATION | AST | PAST. StarttermDecl = BASIC | ALL.Id are non-empty sequences of characters except space, '(', ')', '"', ':' and ',' and excluding special sequences '->', '==', '-><-', '|', '||' and keywords INNERMOST, RULES, STRATEGY, GOAL, TERMINATION, AST, PAST, STARTTERM, ALL, BASIC and VAR.
(GOAL AST)
(VAR x)
(RULES
g(x) -> 1 : g(g(x)) || 1 : x
)
(GOAL AST)
(VAR x)
(RULES
g(x) -> 1/2 : g(g(x)) || 1/2 : x
)
(GOAL AST)
(STRATEGY INNERMOST)
(VAR x)
(RULES
g(x) -> 1/2 : g(g(x)) || 1/2 : x
)
(GOAL AST)
(STARTTERM BASIC)
(VAR x)
(RULES
g(x) -> 1/2 : g(g(x)) || 1/2 : x
)
(GOAL TERMINATION)
(VAR x)
(RULES
g(x) -> 1/2 : g(g(x)) || 1/2 : x
)
(GOAL TERMINATION)
(STRATEGY INNERMOST)
(VAR x)
(RULES
g(x) -> 1/2 : g(g(x)) || 1/2 : x
)
(GOAL PAST)
(STRATEGY INNERMOST)
(VAR x)
(RULES
g(x) -> 1/2 : g(g(x)) || 1/2 : x
)