FO(C)
A Knowledge Representation Language of Causality:
Inference and Related Paradigms
Bart Bogaerts
References
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.
Geef bij laatste coffee spilling voorbeeldje
CP-Logic
Eerst wat background: CP logic is an existing language which we extended and integrated the extension with first-order logic
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}
\]
Pedalling causes ... (Pedal=exogeneous: not governed by causal rules. Turn=endogenous: govenred by causal rules)
local description of a conditional effect
Semantics is defined by an execution of the rules
Process described: LIMIT IS WHAT INTERESTS US!!!!!
Non-Determinism
\[\mathrm{Turn}(\mathrm{SmallGear}) \,\mathbf{Or}\, \mathrm{ChainBreaks} \leftarrow \mathrm{Turn}(\mathrm{BigGear})\]
Branching of possibilities
Semantics: Two different processes.
Structure is a model if it is a final state of one of the processes
(normally probabilistic. not of our interest)
C-Log
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
...
Extension van de NIET PROBABILISTISCHE versie van Cplogic
Dynamic Choice
\[\mathbf{Select}\, x[\varphi(x)]: C\]
Semanitics: many different processes, depending on \varphi
Lottery
\[\mathbf{Select}\, x[Plays(x)]: Rich(x)\]
In CP-Logic: only possible if $Plays$ is known statically
\[Rich(Alice)\,\mathbf{Or}\,Rich(Bob)\,\mathbf{Or}\,\dots\]
Robot
\[\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\}\]
Nesting
Arbitrary nesting of effects
E.g. conditional effects within select expressions
Lightning
\[
\left(\mathbf{Select}\, h[House(h)]: (\mathbf{All} \, o[In(o,h)]: Broken(o)) \right)\] \[ \leftarrow Lightning
\]
Notice the All
Does exactly what you think: cause something for all instantiations of o satisfying the condition
Object Creation
\[\mathbf{New}\, x: C\]
Existence of objects governed by causal rules
Semantics: roughly "Domains of the structure in a process are variable".
Again... Only interested in final states.
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}
\]
Extensions of protocol
Packets are received unknown time later
Possible resend: multiple packages on ch with same content
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
$
A set of CEEs syntactically: And-conjunction
Semantics
Generalisation of instance-based semantics for D-LP
Based on Approximation Fixpoint Theory
FO(C)?
First-order logic + C-Log
Explain semantics: something is a model of C-Log if... Final state. Of FO(C) expression if ... model of its clog and model of its sentences
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
Compare to: FO, ASP (including Disjunctive LP), and other rule based paradigms.
First part: ignore the "new" values
Afterwards, they are important
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$
Robot
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\}\]
Observation:
There is a red door that is open
$\exists d [Red(d) \land Door(d)]: Open(d).$
Robot
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}
\]
For blocks
choose t to put in oven
t + D, where D fixed delay,take out
In FO
More complex relations "after leaving test if ready... almost impossible in FO
Steel Oven Scheduling
$ \lnot \exists t, b, b'[b\neq b']: In(b,t)\wedge In(b',t)$
a constraint that no two blocks can enter
the oven at the same time,
In FO:
easy.
In C-Log
Hard. It's doable if you impose an order on your blocks
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)
\]
Constructive vs assertional
similar to
generate & test
Syntacitc similarity
Example
Spilling coffee causes
Fire causes a burn
C-Log:
\[\left\{\begin{array}{l}Burn\,\mathbf{Or}\,Stain \leftarrow Coffee \\Burn\leftarrow Fire\end{array}\right\}\]
D-ASP:
\[\left\{\begin{array}{l}Burn\vee Stain \,\text{:-}\, Coffee\\ Burn \,\text{:-}\, Fire\end{array}\right\}\]
Two independent causal rules
in ASP: geen goede voorstelling. Syntactisch gelijkaardig wel
Minimality condition in D-ASp: if there is fire, coffee cannot cause stains.
D-ASP
does not respect the principle of independent causation
nuanceer een beetje
Which states that different causal rules act indepentently
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}\]
Leg uit: forall: all
exists: select
In the paper: formalise the relationship
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
Don't go in too deep
Merk op: existenially quantified head varaibles are used for OBJECT CREATION in some datalog extensions.
We make an explicit distinction
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)
...
Questions?
About the first part
In a few minutes I shall continue about the second paper.
But first... Questions about this one?
Inference
Inference in the FO(C) Modelling Language
Overview
Background: FO(ID)
Normal forms for FO(C)
Relation with FO(ID)
Complexity of inference in FO(C)
Our transfos introduce new symbols.
FO(ID)
First-order logic
Inductive Definitions
Inductive Definitions
Sets of rules of the form $\forall x: P(\bar{t})\leftarrow \varphi$
See correspondence to C-Log
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}
\]
IDP
Knowledge Base System for FO(ID)
Goal: use IDP to perform inference on FO(C)
KBS for FO(ID): supports many forms of inference on FO(ID) theories
For our goal: we first study the relationship between FO(C) and FO(ID)
Normal Forms And Transformation
NestNF
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\}\]
All these normal forms are defined in the C-Log part. FO part can be anything
zeggen welke transfos we hebben.
Let uit: DefNF = FO(ID), semantics agree
Leg uit: extra symbols
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\}\]
Example
\[
\mathbf{Select}\, h[House(h)]: (\mathbf{All} \, o[In(o,h)] Broken(o)) \] \[ \leftarrow Lightning
\]
becomes
\[\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\}
\]
Probably more understandable....
Correctness of this transformation: reusing existing algebraical results
From NestNF to Deterministic
Idea: explicitly represent choices
Example
\[\mathrm{Turn}(\mathrm{SmallGear}) \,\mathbf{Or}\, \mathrm{ChainBreaks} \leftarrow \mathrm{Turn}(\mathrm{BigGear})\]
becomes
\[\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\}\]
Example
\[\mathbf{Select}\, x[Plays(x)]: Rich(x)\]
becomes
\[
\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}\]
Eliminating New: similar but more cautiousness is needed....
From Deterministic to DefNF
Pushing $\mathbf{All}$ through $\mathbf{And}$:
\[\mathbf{All}\, x[\varphi]: C_1\,\mathbf{And}\,C_2\]
becomes
\[\left\{\begin{array}{l} \mathbf{All}\, x[\varphi]: C_1\\
\mathbf{All}\, x[\varphi]: C_2\end{array}\right\}\]
Model Expansion
NP-complete
Model Checking
NP-complete
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
Implementation
Prototype of transformation, model expansion and model checking in IDP
References
(
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 .