prism.P:  Implementation of Prism; explanation graphs are simple DAGs
xpita.P:  Implementation of PITA; stores and processes explanation graphs as BDDs.
          Needs bdd.P
ptlp.P:   Implementation of PTLP; stores and processes explanation graphs as 
          cyclic BDDs.  Needs residue2ff, compare_temporal and merge_bdds.
	  Input programs have ".ptlp" extension and are converted to plain Prolog 
	  programs using ptlpload/1 defined in ptlpload.P.

The above three programs implement get_prob/2 that determines the probability
 of a given goal (answer).  Assume that the goal is already evaluated and its
explanation graph can be inferred from the residue.

bdd.P:  Provides skeleton for basic BDD operations, given
        compare_pred/3 and merge/4.  These two operations are defined in each of 
        the three implementations above.  

	The relative ordering of two BDD nodes is determined by compare_temporal/3.
	compare_temporal(+P1, +P2, -C), given two BDD nodes P1 and P2, returns their
	relative order in C.  C can be less, greater, equal or overlap.  
	For xpita's implementation, C is never overlap; for ptlp's implementation,
	C is overlap if the histories of the two nodes are overlapping.

        When performing a BDD and/or operation, if two nodes have overlapping 
        histories,  then merge/4 is invoked to perform the merge of the two nodes.

compare_temporal.P:
        Defines compare_pred/3 for ptlp as follows:

compare_pred(+P1, +P2, -C): 
        Compare the two given BDD nodes, P1 and P2.
        The bdd nodes may be msw(X,I) or node(X,I), 
        where X is the rv or node name, and I is the history.

        If P1 should precede P2 in a BDD path, C = less
        If P1 should succeed P2 in a BDD path, C = greater
        If P1 and P2 are identitcal, C = equal
        If P1 and P2 have overlapping histories, C = overlap
        If P1 and P2 have *disjoint* histories, then they are compared based
          on node names to determine which of P1 or P2 should occur earlier in a
          BDD path.

merge_bdds.P:
	Defines merge/4 for ptlp, as follows:

merge(+Op, +(P1,A1), +(P2, A2), -(Q,A)):
           Op is and/or
           P1, P2 are BDD nodes, and A1, A2 are their corresponding
           (lists of) children.  
           Q is a BDD node and A is a list of its children.

residue2ff.P:
	Defines resid2ff/2 used in ptlp.P.  This predicate builds FEDs from 
	explanations (asserted as residue/2). 

ptlpload.P:
	Rewrites programs with temporal declaration to abstract calls
	to temporal predicates.
