ComputeReachabilityInformation(I, O)
Input: The initial state of the planning problem under consideration ( I ) and all ground instances of the operators ( O );
Output:  An estimate of the number of actions ( Num acts ) and of the earliest time
( Time-fact ) required to achieve each fact from I .

forall facts f   /* the set of all facts is precomputed by the operator instantiation phase */
1.

2.

if f E I then Num acts (f, 1) ← 0; Time fact (f, 1) ← 0; Action (f, 1) ← astart; 3.

else Num acts(f,1) ← –1; 4.

5.

F ← I; Fnew ← I; A ← O;
while  Fnew ≠ 0 6.

F ← F U Fnew  ← O
7.

8.

while  A' = {a ∈ A | Pre(a) ⊆ F} is not empty 9.

a ← an action in A':
10.

ra ← RequiredActions(I, Pre(a));
t ← MAX  Time_fact(f,1);
11. 12.

forall f ∈ Add(a)
if f & F UFnew or Time_fact(f,1) > (t + Duration(a)) then 13.

14.

Time_fact(f, 1) ← t + Duration(a);
15.

if f F U Fnew or Num acts(f,1)> (ra + 1) then 16.

Num act s( f, 1) ← ra + 1; 17.

Action(f, 1) ← a; Fnew ← Fnew ∪ Add(a) - F ;
18.

19.

A ← A = {a};
RequiredActions(I,G)
Input: A set of facts I and a set of action preconditions G; Output: An estimate of the minimum number of actions required to achieve all facts in G
from I ( ACTS ).

ACT S ← 0; 1.

G ← G - I ;

2.

while G ≠ 0 3.

4.

g ← an element of G;

a ← Action(g, 1):
5.

ACTS ← ACTSU { a } ;
6.

G ← G U Pre(a) - I - UbEACTs Add(b);
7.

ret urn(| A CT S |).

8 Figure 6: Algorithms for computing heuristic information about the reachability of each fact.