Alternative view: CP-logic

An alternative view of ProbLog – and the motivation for adding syntax for annotated disjuncts to ProbLog – is the CP-logic language.

  • J. Vennekens, M. Denecker and M. Bruynooghe. CP-logic: A language of causal probabilistic events and its relation to logic programming. Theory and Practice of Logic Programming, pp. 245 - 308, 2009. PDF
  • Example 1

    The following example expresses a chain of events that happen when a person throws a rock. Two people, Suzy and Billy, may each decide to throw a rock at a bottle. Suzy throws with a probability 0.5 and if she does, her rock breaks the bottle with probability 0.8. Billy always throws and his rock hits with probability 0.6.

    0.5::throws(suzy). throws(billy). 0.8::broken; 0.2::miss :- throws(suzy). 0.6::broken; 0.4::miss :- throws(billy). query(broken).

    The semantics of CP-logic is defined using the concept of an execution model. This is a probability tree in which each node s is labeled with a set of partial truth value assignments to atoms, which we denote as an interpretation I(s). Such trees are constructed, starting from a root node in which all atoms are false, by “firing” rules whose body holds. The following is an execution model for the example above. States s in which the bottle is broken are represented by an empty circle, and those in which it is still whole by a full one.

    ../../_images/16_cplogic_img1.png

    Each such tree defines a probability distribution over its leaves, which induces a probability distribution over the interpretations I(s) that are associated to these leaves.

    P(broken) = 0.5*0.8*1.0*0.6+0.5*0.8*1.0*0.4+0.5*0.2*1.0*0.6+0.5*1.0*0.6 = 0.76

    A CP-theory may have many execution models, which differ in the order in which they fire rules. The differences between these trees are irrelevant, in the sense that they all produce the same probability distribution in the end.

    Example 2

    In case we want to represent multiple bottles, we can make use of a logic variable. The following example expresses that “throwing a rock at a bottle breaks it with probability 0.3 and misses it with probability 0.7”:

    throwAt(mary,firstbottle). 0.3::broken(B); 0.7::miss :- throwAt(P,B). query(broken(_)). query(miss).
    ../../_images/16_cplogic_img2.png