-
Notifications
You must be signed in to change notification settings - Fork 2
/
PPDDLsub.ebnf
24 lines (24 loc) · 1.44 KB
/
PPDDLsub.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
start = program;
program = "(define " problem:problem init:[init] goal:goal extra:[goal_reward] actions:{action} ")";
problem = "(problem " problem_name:atom ")";
init = "(:init " conjunction:negfreeconjunction ")";
goal = "(:goal " subgoals:dnf ")";
goal_reward = "(:goal-reward " goal_reward:value ")";
action = "(:action " name:atom precondition:[precondition] effect:[effect] ")";
precondition = ":precondition " args:dnf;
effect = ":effect " args:(effect_conjunction | probabilistic); (* an effect will be preprocessed to always be probabilistic *)
probabilistic = "(probabilistic " prob_effects:{prob_effects} + ")"; (* return a list of probabilistic effects in effects.args *)
prob_effects = value:value conjunction:effect_conjunction;
dnf = disjunction+:conjunction | "(or " disjunction:{conjunction} ")";
effect_conjunction = args+:effect_term | "(and " args:{effect_term} ")";
effect_term = predicate | negation | reward_increase | reward_decrease;
reward_increase = "(increase " "(reward)" increase:value ")";
reward_decrease = "(decrease " "(reward)" decrease:value ")";
conjunction = args+:term | "(and " args:{term} ")";
negfreeconjunction = args+:negfreeterm | "(and " args:{negfreeterm} ")";
term = predicate | negation;
negfreeterm = predicate;
negation = "(not " negation:{predicate} ")";
predicate = atom:atom | "(" atom:atom ")";
atom = ?/[a-zA-Z][a-zA-Z0-9_-]*/?;
value = ?/([0-9]+\/[1-9][0-9]*)|([-+]?([0-9]*\.[0-9]+|[0-9]+))/?;