A Knowledge Representation Language of Causality: 

Inference and Related Paradigms

Bart Bogaerts


  • FO(C) and Related Modelling Paradigms
  • Inference in the FO(C) Modelling Language

Bart Bogaerts, Joost Vennekens, 
Marc Denecker and Jan Van den Bussche

Principle of Causation

  • Universal causation: all changes to the state of the domain must be triggered by a causal law whose precondition is satisfied.
  • Sufficient causation: if the precondition for a causal law is satisfied, then the event that it triggers must eventually happen.
  • Independent causation: which event a causal law triggers is not influenced by other causal laws.


Cause-effect relations

\[ \begin{align} \mathrm{Turn}(\mathrm{BigGear}) &\leftarrow \mathrm{Pedal}. && (1) \\ \mathrm{Turn}(\mathrm{BigGear}) &\leftarrow \mathrm{Turn}(\mathrm{SmallGear}). && (2)\\ \mathrm{Turn}(\mathrm{SmallGear}) &\leftarrow \mathrm{Turn}(\mathrm{BigGear}). && (3) \end{align} \]

\[ \begin{equation}\label{branch} \{\mathrm{P}\} \overset{(1)}{\rightarrow} \{\mathrm{P},\mathrm{T}(\mathrm{B})\} \overset{(3)}{\rightarrow} \{\mathrm{P},\mathrm{T}(\mathrm{B}),\mathrm{T}(\mathrm{S})\} \overset{\text{(2)}}{\rightarrow} \{\mathrm{P},\mathrm{T}(\mathrm{B}),\mathrm{T}(\mathrm{S})\} \end{equation} \]


\[\mathrm{Turn}(\mathrm{SmallGear}) \,\mathbf{Or}\, \mathrm{ChainBreaks} \leftarrow \mathrm{Turn}(\mathrm{BigGear})\]

Branching of possibilities


  • Extension of CP-Logic
  • Motivation: many things are not naturally expressable in CP-Logic
  • Expressive language for cause-effect relations
    • Non-deterministic choice
      • Dynamic set of alternatives
    • Object creation
    • Arbitrary nesting
    • ...

Dynamic Choice

\[\mathbf{Select}\, x[\varphi(x)]: C\]


\[\mathbf{Select}\, x[Plays(x)]: Rich(x)\]

In CP-Logic: only possible if $Plays$ is known statically


\[\left\{\begin{array}{l}Open(x)\leftarrow Open_I(x)\\ \mathbf{Select}\, x[Door(x)]: Open(x)\\ \mathbf{Select}\, x[Door(x)\wedge Open(x)]: Exit(x)\end{array}\right\}\]


Arbitrary nesting of effects


\[ \left(\mathbf{Select}\, h[House(h)]: (\mathbf{All} \, o[In(o,h)]: Broken(o)) \right)\] \[ \leftarrow Lightning \]

Object Creation

\[\mathbf{New}\, x: C\]
Existence of objects governed by causal rules

Mail Protocol

\[\begin{array}{l}\mathbf{All}\, m, t[HitSend(m,t)]: \mathbf{New}\, p:\\ \quad Pack(p) \,\mathbf{And}\, OnCh(p,t)\,\mathbf{And}\, Cont(p,m) \end{array} \]

Summary: syntax

A Causal Effect Expression (CEE) is one of the following:
(if $C$, $C_1$, $C_2$ are CEEs, $\varphi$ a formula, $A$ an atom, $x$ a variable)
  • $ A $
  • $ C\leftarrow \varphi $
  • $ C_1 \,\mathbf{And}\, C_2 $
  • $ C_1 \,\mathbf{Or}\, C_2 $
  • $ \mathbf{All}\, x[\varphi]: C $
  • $ \mathbf{Select}\, x[\varphi]: C $
  • $ \mathbf{New}\, x: C $


Generalisation of instance-based semantics for D-LP
Based on Approximation Fixpoint Theory


First-order logic + C-Log

Related Formalisms

FO(C) and Related Modelling Paradigms
  • C-Log vs FO
  • FO(C) vs Disjunctive ASP
  • Object creation in FO(C) vs in other paradigms

C-Log, FO and FO(C)

\[ \begin{array}{c|c} \mathrm{\bf C-Log}& \mathrm{\bf FO}\\ \hline C_1 \,\mathbf{And}\, C_2 & \psi_1\wedge \psi_2\\ C_1 \,\mathbf{Or}\, C_2 & \psi_1\vee \psi_2\\ C_1 \leftarrow \varphi & \psi_1\Leftarrow \varphi\\ \mathbf{All}\,x[\varphi]: C_1 & \forall x[\varphi]: \psi_1\\ \mathbf{Select}\,x[\varphi]: C_1 & \exists x[\varphi]: \psi_1\\ \mathbf{New}\,x: C_1 & / \end{array} \]

Restricted quantification in FO:
$\forall x[\varphi]:\psi$ is $\forall x:\varphi\Rightarrow \psi$
$\exists x[\varphi]:\psi$ is $\exists x:\varphi\wedge \psi$


Causal information:
\[ \left\{\begin{array}{l} Open(x)\leftarrow Open_I(x) \\ \mathbf{Select}\, x[Door(x)]: Open(x)\\ \mathbf{Select}\, x[Door(x)\wedge Open(x)]: Exit(x)\end{array}\right\}\]

There is a red door that is open
$\exists d [Red(d) \land Door(d)]: Open(d).$


Not equivalent with
\[ \left\{\begin{array}{l} Open(x)\leftarrow Open_I(x)\\ \mathbf{Select}\, x[Door(x)]: Open(x)\\ \mathbf{Select}\, x[Door(x)\wedge Open(x)]: Exit(x)\\ \mathbf{Select}\, d [Red(d) \land Door(d)]: Open(d)\end{array}\right\}\]

C-Log vs FO

  • Causal info vs observations
  • Constructive vs assertional
  • Both useful?

Steel Oven Scheduling

\[ \left\{\mathbf{All}\, b[Block(b)]: \mathbf{Select}\, t: In(b,t) \,\mathbf{And}\,Out(b,t+D) \right\}\]

\[\begin{array}{l} \forall b [Block(b)]: \exists t:In(b,t) \wedge Out(b,t+D)\\ \forall b, t, t' [Block(b)]: In(b,t)\wedge In(b,t')\Rightarrow t= t'\\ \forall b, t, t' [Block(b)]: Out(b,t)\wedge Out(b,t')\Rightarrow t= t'\\ \forall x: (\exists t: In(x,t)\vee Out(x,t)) \Rightarrow Block(x) \end{array} \]

Steel Oven Scheduling

$ \lnot \exists t, b, b'[b\neq b']: In(b,t)\wedge In(b',t)$

C-Log vs FO

  • Causal info vs observations
  • Constructive vs assertional
  • Both useful!

FO(C) vs Disjunctive ASP

D-ASP \[p_1\vee\dots\vee p_n\,\text{:-}\, q_1,\dots, q_m , \mathbf{not}\, r_1, \dots, \mathbf{not}\, r_l\]
C-Log \[ p_1\,\mathbf{Or}\,\dots\,\mathbf{Or}\,p_n\leftarrow q_1\wedge\dots\wedge q_m \wedge \lnot r_1\wedge \dots\wedge \lnot r_l \]

D-ASP\[\text{:-}\, q_1,\dots, q_m , \mathbf{not}\, r_1, \dots, \mathbf{not}\, r_l\]
FO \[\lnot (q_1\wedge\dots\wedge q_m \wedge \lnot r_1\wedge \dots\wedge \lnot\wedge r_l) \]


Spilling coffee causes
  • a burn, or
  • a stain

Fire causes a burn

\[\left\{\begin{array}{l}Burn\,\mathbf{Or}\,Stain \leftarrow Coffee \\Burn\leftarrow Fire\end{array}\right\}\]

\[\left\{\begin{array}{l}Burn\vee Stain \,\text{:-}\, Coffee\\ Burn \,\text{:-}\, Fire\end{array}\right\}\]


does not respect the principle of independent causation

Non-overlapping programs

Non overlapping: no two disjunctive rules share  an atom
Semantics of FO(C) correspond to stable semantics

\[\left\{\begin{array}{l}Burn_1\vee Stain \,\text{:-}\, Coffee\\ Burn_2 \,\text{:-}\, Fire\\Burn\,\text{:-}\,Burn_1\\Burn\,\text{:-}\,Burn_2\end{array}\right\}\]

E-Disjunctive ASP

Results generalise to rules of the form
\[\forall \bar{x} :\exists \bar{y}: \alpha_1\vee \dots\vee \alpha_m \,\text{:-}\, \beta_1,\dots,\beta_k, \mathbf{not}\, \gamma_1,\dots,\mathbf{not}\, \gamma_n.\]

\[\begin{array}{c|c}\mathbf{FO(C)} & \mathbf{ASP}\\ \hline \mathbf{Select}& \exists\\ \mathbf{All} & \forall\\ \mathbf{Or} & \vee\\ \leftarrow & \text{:-}\\ \end{array}\]

Object creation

Similar to object creation in 
  • Mathematics: \[\left\{\begin{array}{l} \mathbf{New}\,x: Nat(x)\wedge Zero(x) \\ \mathbf{All}\, y[Nat(y)]: \mathbf{New}\,x:Nat(x)\,\mathbf{And}\, Succ(y,x)\end{array}\right\}\]
  • Datalog extensions (Abiteboul and Vianu 1991): \[\exists i: CountryID(i), idOf[c] = i \leftarrow Country(c)\]
  • Business Rule Systems

Many more related paradigms

  • The logic of cause and change (McCain and Turner 1996)
  • BLOG (Milch et al. 2005)
  • P-Log (Baral, Gelfond, and Rushton 2004)
  • Structural models (Pearl 2000)
  • Representations of causal logics in ASP (many people)
  • ...


About the first part


Inference in the FO(C) Modelling Language


  • Background: FO(ID)
  • Normal forms for FO(C)
  • Relation with FO(ID)
  • Complexity of inference in FO(C)


  • First-order logic
  • Inductive Definitions

Inductive Definitions

Sets of rules of the form $\forall x: P(\bar{t})\leftarrow \varphi$

FO(ID) example

\[ \begin{array}{l} \left\{ \begin{array}{l} \forall x,y: R(x,y) \leftarrow Edge(x,y)\\ \forall x,y: R(x,y) \leftarrow \exists z: R(x,z) \wedge R(z,y) \end{array} \right\}\\ R(Start,End) \end{array} \]


Knowledge Base System for FO(ID)

Goal: use IDP to perform inference on FO(C)

Normal Forms And Transformation

  • NestNF
    • Not "too much" nesting
  • Deterministic
    • No $\mathbf{Select}$, $\mathbf{Or}$ or  $\mathbf{New}$ expressions
  • DefNF
    • Of the form \[\left\{\begin{array}{l} \mathbf{All}\,\bar{x}_1[\varphi_1]: P_1(\bar{t}_1)\\ \mathbf{All}\,\bar{x}_2[\varphi_2]: P_2(\bar{t}_2)\\\cdots  \end{array}\right\}\]

From FO(C) to NestNF

$C$ subexpression of $C_1$
$C_1$ becomes
\[\left\{\begin{array}{l} C_1[P(\bar{x})/C] \\\mathbf{All}\, \bar{x}[P(\bar{x})]: C\end{array}\right\}\]


\[ \mathbf{Select}\, h[House(h)]: (\mathbf{All} \, o[In(o,h)] Broken(o)) \] \[ \leftarrow Lightning \]
\[\left\{\begin{array}{l} \mathbf{Select}\, h[House(h)]: Hit(h) \leftarrow Lightning\\ \mathbf{All} \, h[Hit(h)]: \mathbf{All} \, o[In(o,h)] Broken(o)\end{array}\right\} \]

From NestNF to Deterministic

Idea: explicitly represent choices


\[\mathrm{Turn}(\mathrm{SmallGear}) \,\mathbf{Or}\, \mathrm{ChainBreaks} \leftarrow \mathrm{Turn}(\mathrm{BigGear})\]
\[\left\{\begin{array}{l}\mathrm{Turn}(\mathrm{SmallGear}) \leftarrow \mathrm{Turn}(\mathrm{BigGear}) \wedge First\\ \mathrm{ChainBreaks} \leftarrow \mathrm{Turn}(\mathrm{BigGear}) \wedge \lnot First\end{array}\right\}\]


\[\mathbf{Select}\, x[Plays(x)]: Rich(x)\]
\[ \begin{array}{l} \left\{\begin{array}{l} \mathbf{All}\, x[Selected(x)]: Rich(x)]\end{array}\right\}\\ \exists_1 x: Selected(x)\\ \forall x: Selected(x)\Rightarrow Play(x)\end{array}\]

From Deterministic to DefNF

Pushing $\mathbf{All}$ through $\mathbf{And}$:

\[\mathbf{All}\, x[\varphi]: C_1\,\mathbf{And}\,C_2\]
\[\left\{\begin{array}{l} \mathbf{All}\, x[\varphi]: C_1\\ \mathbf{All}\, x[\varphi]: C_2\end{array}\right\}\]

Complexity results

Model Expansion


Model Checking


FO(C) theory $T$: transform to $\exists \bar P: T'$, where $T'$ is an FO(ID) theory
Model checking of FO(C) = Model checking of $\exists SO$

(Unbounded) Endogenous Model Generation

Given: domain + interpretation for exogenous symbols
Find: model with larger domain (all new elements created by $\mathbf{New}$)
Can decide every decidable class of finite structures


Prototype of transformation, model expansion and model checking in IDP


( B. Bogaerts, J. Vennekens, M. Denecker and J. Van den Bussche )
  • Inference in the FO(C) Modelling Language 
    • European Conference on Artificial Intelligence (ECAI), 2014.
    • 15th International Workshop on Non-Monotonic Reasoning 2014 .
  • FO(C) and Related Modelling Paradigms 15th International Workshop on Non-Monotonic Reasoning, 2014.

  • FO(C): A Knowledge Representation Language of Causality International Conference of Logic Programming (ICLP), (Technical communication), 2014.