[The following is taken from the Fast Downward distribution, written
by Malte Helmert, and has only been slightly adapted]

This file describes the output format of the "preprocess" program. The
description assumes that the reader is already familiar with the output
format of the translator, described in the file sas-format.txt. The
output of the translator ("output.sas") is referred to as the "SAS file"
in what follows, while the format of the preprocessor ("output")
described here will be called the "PRE file". The format of the two is
generally similar.

PRE file format
===============
The file has 10 parts, which appear in the following sequence:

  1. easy MPT flag
  2. metric section
  3. variables section
  4. initial state section
  5. goal section
  6. operator sections
  7. axiom sections
  8. successor generator section
  9. domain transition graph sections
  10. causal graph section

I'll describe these now.

easy MPT flag
-------------
This is a single line, which is either "0" or "1". If it is "1", then
the problem has been detected to be solvable by the simple
hierarchical approach described in the JAIR 2006 paper on Fast
Downward (algorithm "solve-easy-MPT", Figure 12). In practice, you can
safely ignore it. (That's what our current planner implementation
does.)

metric section
--------------

This is the same format as in the SAS file.

variables section
-----------------
This is in the same format as in the SAS file. Note that the order of
variables can be different from the SAS file, and some variables from
the SAS file detected as unnecessary can be missing. To see which
variables in the PRE file correspond to which variables in the SAS
file, check the "names" of the variables. For example, the section can
begin like this:

    begin_variables
    45
    var9 2 -1
    var11 2 -1
    var14 2 -1

This means there are 45 variables, and the first of these (variable
#0) has the name "var9", which means that it is variable #9 in the SAS
file. The variable has two values in its domain and is not an axiom
(axiom layer -1). Similarly, variable #1 corresponds to variable #11
in the SAS file, and variable #2 corresponds to variable #14 in the
SAS file.

initial state section
---------------------
This is in the same format as in the SAS file. The section will still
look different in both files because the variables have been
renumbered.

goal section
------------
This is in the same format as in the SAS file. The section will still
look different in both files because the variables have been
renumbered.

operator sections
-----------------
This is structured the same way as in the SAS file: first, a line that
gives the number of operators, then a begin_operator ... end_operator
section for each operator. The only difference is that the line breaks
in the begin_operator ... end_operator sections are different: in the
SAS file, each pre/postcondition entry is spelled on a single line,
but in the PRE file it is spelled out on several lines. For example, a
pre/postcondition entry in the SAS file might look like this:

    2 6 2 7 4 5 -1 3

This describes an effect which triggers when 2 (first number) effect
conditions are met, namely that variable #6 has value 2 and variable
#7 has value 4. If the effect triggers, variable #5 changes its value
to 3 (last number). The second-last number (-1) indicates that there
is no precondition on variable #5.

In the PRE file, there will be a line break after the number of effect
conditions and after each such condition, so this is written like:

    2
    6 2
    7 4
    5 -1 3

If you ignore line breaks, the format is the same.

axiom sections
--------------
This is in the same format as in the SAS file: first a line with the
number of axioms, then begin_rule ... end_rule sections in the same
format as in the SAS file.

successor generator section
---------------------------
This describes the successor generator for the problem (see the JAIR
paper on Fast Downward, Section 5.3.1). This is a block that begins
with a "begin_SG" line and ends with an "end_SG" line.

This part is not explained in detail here, as it is not needed by most
people. If you need further explanation, please ask.

domain transition graph sections
--------------------------------
Here, there is one section begin_DTG ... end_DTG for each variable of
the problem. The k-th section of this kind corresponds to the DTG for
variable #k.

Each section has the following structure:

    begin_DTG
    [Block for value 0]
    [Block for value 1]
    ...
    [Block for last value]
    end_DTG

Each block describes the outgoing arcs of the corresponding node in
the DTG. So for example, the fifth block (#4) in the third (#2) DTG
section describes the outgoing transitions in the DTG for variable #2
for the value #4. Such a value block looks like follows:

    number of transitions
    [description of first transition]
    [description of second transition]
    ...
    [description of last transition]

Each description of a transition looks like the following:

    target value
    operator/axiom number
    number of conditions for the transition
    variable/value pair for the first transition condition
    variable/value pair for the second transition condition
    ...
    variable/value pair for the last transition condition

The "target value" is the value for the DTG variable that is achieved
by the transition.

The operator/axiom number is the number of the operator or axiom that
is associated with the transition. (Whether it refers to an axiom or
operator depends on whether the DTG variable is derived or not.)
Operators and axioms are numbered in the order in which they appear in
the PRE file; counting starts from 0 in both cases.

The description of the variable/value pairs is the same as elsewhere
(e.g. in operator preconditions).

For example, the description for a given transition could look like this:

    1
    16
    2
    4 0
    40 0

This means that this transition reaches value #1, corresponds to
operator or axiom #16, and has two associated conditions: variable #4
must have the value 0, and variable #40 must also have the value 0.

causal graph section
--------------------
This has a similar structure as a DTG description. It looks like this:

    begin_CG
    [Block for variable #0]
    [Block for variable #1]
    ...
    [Block for last variable]
    end_CG

Each variable block describes the outgoing arcs for this vertex of the
graph, in this format:

    number of arcs
    [description of first arc]
    [description of second arc]
    ...
    [description of last arc]

Each arc description is a pair

    target weight

where target is the variable (i.e., causal graph vertex) that the arc
points to, and weight is a "weight" for this arc (if I recall
correctly, this is the number of DTG transitions that induce this
arc). The weight information is not currently used for anything in
particular; we just added it as an additional piece of information.
