Output of the Fast Downward translator

This page describes the output format of the translation component of Fast Downward.

Version history

This page describes version 4 of the output file format. The following list gives a brief version history:

/!\ NOTE: After work on this page has begun, there have been changes to TranslatorOutputPage that have not yet been ported to this page. (See the history for that page.) It is probably difficult to try to keep this in sync all the time because not everyone is aware of the existence of this page, so I suggest we do a diff/meld/trawl through the history to see which changes to TranslatorOutputPage need to be merged to this page at the time that this page becomes the "official" documentation page for the translator output format.

Translation file format

The translation file consists of eight sections:

  1. Version section

  2. Metric section

  3. Variables section

  4. Mutex section

  5. Axiom defaults section

  6. Axiom section

  7. Operator section

  8. Initial state section

  9. Goal section

Translation file format: version section

The version section includes a version number that is used by the preprocessor to determine if its input has been generated by a compatible translator version.

It always looks like this for the version of the translator documented here:

Sample version section:

begin_version
4
end_version

Translation file format: metric section

The metric section indicates whether action costs are used or not. It begins with the line "begin_metric", followed by either a 0 or 1. 0 indicates that action costs are not used, and all actions are treated as unit-cost. 1 indicates that action costs are used. The section ends with the line "end_metric".

Sample metric section (Gripper domain):

begin_metric
0
end_metric

Translation file format: variables section

Background: the translation process works by partitioning the fluent facts of the grounded PDDL task into sets of mutually exclusive propositions ("mutex groups"). Such a partitioning is always possible since a decomposition into trivial mutex groups with only one element always works. However, the translator prefers to use larger mutex groups, trying to find a cover with few groups. A mutex group consisting of facts {p_1, ..., p_k} is turned into a finite-domain variable with domain {0, 1, ..., k}, where value i < k means that fact p_{i+1} is true and all others are false, and value k means that all facts are false. (Sometimes this last value is omitted because the translator detects that at least one fact from the group must always be true.)

The variables section begins with a line containing a single number, the number of finite-domain variables in the task. Following that line, each variable is defined in sequence.

An variable definition is structured as follows:

For state variables that do not correspond to axioms, i.e. which are not computed from the values of other state variables, the axiom layer is always -1. For state variables that do correspond to axioms, the axiom layer determines the order of evaluation of axiom rules, described further below in the section "Evaluating Axioms".

Sample variables section (Gripper domain, prob01.pddl from IPC 1998):

  7
  begin_variable
  var0
  -1
  5
  Atom carry(ball1, right)
  Atom carry(ball2, right)
  Atom carry(ball3, right)
  Atom free(right)
  Atom carry(ball4, right)
  end_variable
  begin_variable
  var1
  -1
  5
  Atom carry(ball3, left)
  Atom free(left)
  Atom carry(ball2, left)
  Atom carry(ball1, left)
  Atom carry(ball4, left)
  end_variable
  begin_variable
  var2
  -1
  3
  Atom at(ball4, rooma)
  Atom at(ball4, roomb)
  <none of those>
  end_variable
  begin_variable
  var3
  -1
  3
  Atom at(ball3, rooma)
  Atom at(ball3, roomb)
  <none of those>
  end_variable
  begin_variable
  var4
  -1
  3
  Atom at(ball1, rooma)
  Atom at(ball1, roomb)
  <none of those>
  end_variable
  begin_variable
  var5
  -1
  3
  Atom at(ball2, rooma)
  Atom at(ball2, roomb)
  <none of those>
  end_variable
  begin_variable
  var6
  -1
  2
  Atom at-robby(roomb)
  Atom at-robby(rooma)
  end_variable

The example shows that there are 7 finite-domain variables in this task. Please note that the order in which the variables are generated and the order of their values are not deterministic and can vary between translator runs.

The first variable is not a derived variable (its axiom layer is -1), and it can take on 5 different values (from the set {0, 1, 2, 3, 4, 5}), which correspond to the PDDL facts (carry ball1 right), (carry ball2 right), (carry ball3 right), (free right), and (carry ball4 right). This represents the state of the right gripper. The next variable is similar, but represents a state of the left gripper.

The third variable is again not derived (axiom layer -1) and takes on three values, corresponding to ball4 being in rooma, ball4 being in roomb, and ball4 being in neither room (which implies that it is carried by either gripper). The next three state variables similarly represent the other balls, and the final state variable represents the location of the robot.

Translation file format: mutex section

The mutex section encodes additional mutual exclusion constraints in the form of mutex groups (groups of variable/value pairs of which no two can be simultaneously true). A mutex group is called trivial if it only represents information that is obvious from the finite-domain representation (that the same variable cannot hold two different values concurrently). The translator may construct some such trivial mutex groups; however, the preprocessor will filter them out, so they will not be seen by the search code.

The mutex section begins with a line containing a single number, the number of mutex groups in the task. Following that line, each mutex group is defined in sequence.

An mutex group definition is structured as follows:

Sample mutex section (Gripper):

  7
  begin_mutex_group
  4
  1 4
  0 4
  2 0
  2 1
  end_mutex_group
  begin_mutex_group
  4
  1 0
  0 2
  3 0
  3 1
  end_mutex_group
  begin_mutex_group
  4
  1 3
  0 0
  4 0
  4 1
  end_mutex_group
  begin_mutex_group
  5
  1 1
  1 4
  1 0
  1 2
  1 3
  end_mutex_group
  begin_mutex_group
  5
  0 3
  0 4
  0 2
  0 1
  0 0
  end_mutex_group
  begin_mutex_group
  2
  6 1
  6 0
  end_mutex_group
  begin_mutex_group
  4
  1 2
  0 1
  5 0
  5 1
  end_mutex_group

There are 7 mutex groups.

The first group encodes that the following variable/value pairs are mutually exclusive: variable 1 has value 4; variable 0 has value 4; variable 2 has value 0; variable 2 has value 1. This corresponds to the PDDL facts (carry ball4 left), (carry ball4 right), (at ball4 rooma), (at ball4 roomb).

The second, third and seventh mutex groups encode similar mutual exclusion constraints for the other three balls.

The fourth, fifth and sixth mutex groups are trivial.

Translation file format: axiom defaults section

The axiom defaults section begins with the line "begin_axiom_defaults", followed by the number of axiom variables (with a non-negative axiom layer). Each of the following lines contains the number of an axiom variable and its "default value" (see section "Evaluating Axioms" below). The axiom defaults specification is ordered by increasing variable index. The section ends with the line "end_axiom_defaults".

Here are the axiom defaults for the Gripper example:

Sample axiom defaults section (Gripper domain):

  begin_axiom_defaults
  0
  end_axiom_defaults

This shows that there are no axiom variables in this domain, which is the case for all pure-STRIPS benchmarks. Axiom variables will of course be generated for domains that contain derived predicates, but they can also be generated for PDDL tasks without derived predicates if they use non-STRIPS features such as universally quantified conditions, as some of these are compiled away with the help of axioms. As an example, here is an axiom rules from a Miconic-FullADL task:

Sample axiom defaults section (Miconic-FullADL domain):

  begin_axiom_defaults
  1
  2 0
  end_axiom_defaults

Translation file format: Axiom section

The axiom section begins with a line containing the number of axiom rules. Following that line, each axiom rule is defined in sequence.

An axiom rule is structured as follows:

Variables appearing in the head of axiom rules (axiom variables) are disjoint from variables affected by operators. In the current version of the translator, axiom variables always have a binary domain.

Axiom rules are ordered increasingly by the affected variable and the assigned value.

In the Gripper example, the axiom section (which has no axiom variables) looks as follows:

Sample axiom section (Gripper domain):

  0

As an example for a task with axiom variables, here is an axiom rules from a Miconic-FullADL task:

Sample axiom section (Miconic-FullADL domain):

  1
  begin_rule
  2
  4 0
  5 0
  3 1
  end_rule

The axiom section contains a single axiom rule. It has two conditions in the body, namely that var4 and var5 are both set to 0, i.e. that passengers p1 and p0 have both been served. The head of the axiom states that if the condition is satisfied, then var3 will assume the value 1. Variable var5 corresponds to a proposition over a newly introduced predicate "new-axiom@9" which has been generated to simplify the original PDDL goal (forall (?p - passenger) (served ?p)). (Of course, in this case the goal could also have been transformed to a simple conjunction in a different way that does not require axioms.)

Translation file format: operator section

The operator section begins with a line containing a single number, the number of operators in the task. Following that line, each operator is defined in sequence.

An operator definition is structured as follows:

Effects can have associated effect conditions (similar to axiom rules). An effect is always given in a single line, with the individual parts separated by spaces. It is structured as follows:

Effects are sorted increasingly by the affected variable. For each variable the effects do not need to be sorted.

Even for fairly small examples, the operator section becomes quite big, so we omit most operator definitions of the Gripper example:

Sample operator section (Gripper domain):

  34
  begin_operator
  drop ball1 rooma left
  2
  4 0
  5 0
  2
  0 0 0
  0 5 4
  1
  end_operator
  [... 33 operators omitted]

The example shows that there are 34 operators in this domain, and two of them are shown in detail.

The first operator is called "drop ball1 rooma left" and has two preconditions: It requires that var4 and var5 are both set to 0 (robot must be in room A and must carry ball 1 in the left gripper). The two effects are unconditional and set var0 to 0 (ball 1 in room A) and var5 to 4 (left gripper empty).

This domain does not use explicit action_costs (as encoded in the metric section), so the final line is 1.

As an example of an operator involving effect conditions, consider the following operator from a task in the Schedule domain:

Sample operator with effect conditions and cost (miconic simple-adl domain, modified with costs):

  begin_operator
  stop f1
  1
  1 1
  1
  1 2 1 0 0
  7
  end_operator

The operator is named "stop f1". It is applicable if the lift is at floor f1 (var1=1). There is only one effect with one effect condition: If var2 is 1 (passenger p0 not served) then it sets var0 to 0 (passenger p0 boarded).

Finally, the 7 before the "end_operator" line indicates that this operator has a cost of 7.

Translation file format: initial state section

The initial state section begins with the line "begin_initial_state", followed by the number of SAS state variables which are no axiom variables (i.e., which do not correspond to derived predicates). Each of the following lines contains the value of one such variable, given by two numbers separated by spaces: pair "i j" means that "var<i>" has initially the value j. These lines are sorted by variable index i. The section ends with the line "end_initial_state".

Here is the initial state section for the Gripper example:

Sample initial state section (Gripper domain):

  begin_initial_state
  7
  0 0
  1 0
  2 0
  3 0
  4 0
  5 4
  6 4
  end_initial_state

There are 7 non-axiom variables (in this STRIPS tasks there are no axiom variables). The initial value of variables var0 to var4 is intitially 0 and the value of var5 and var6 is 4. Looking up the meaning of these values in the variable section shown earlier, this means that exactly the following STRIPS propositions are true in the initial state:

Translation file format: goal section

The goal section begins with the line "begin_goal", followed by a line which contains the number of goal pairings. This is followed by one line for each goal pairing, where a goal pairing is given by two numbers separated by spaces, where the pair "i j" means that "var<i>" must have the value j in the goal. These lines are sorted by variable index i. The goal section ends with the line "end_goal".

Here is the goal section for the Gripper example:

Sample goal section (Gripper domain):

  begin_goal
  4
  2 1
  3 1
  4 1
  5 1
  end_goal

We see that there are four goal conditions: Each of the variables var2 through var5 shall assume the value 1. In other words, the goal is reached if all four balls are in roomb.

Note that the goal condition of the translated task is always a simple conjunction of atomic goals. If the original PDDL goal is more complicated, it is transformed by the translator to fit this requirement. In some cases, this leads to the introduction of derived variables, even if the original PDDL task did not use derived predicates.

Evaluating axioms

State variables that correspond to derived predicates are not directly affected by operator applications. Instead, their values in a given world state are computed from the values of the other state variables using the following algorithm:

The semantics of the translation guarantees that the algorithm always terminates and that the result is independent of the order in which axiom rules at the same layer are considered.

FastDownward: TranslatorOutputFormat4 (last edited 2016-12-21 14:04:44 by MalteHelmert)