An OpenCL implementation of a forward sampling algorithm for CP-logic
Wiebe Van Ranst Joost Vennekens
- KU Leuven
An OpenCL implementation of a forward sampling algorithm for - - PowerPoint PPT Presentation
An OpenCL implementation of a forward sampling algorithm for CP-logic Wiebe Van Ranst Joost Vennekens KU Leuven Campus De Nayer CP-logic PLP language in family of distribution semantics languages PRISM [Sato,Kameya], Independent
FOL formula Atom Probability (sum ≤ 1) Condition φ, when true, causes one of the effects Ei (or none if sum < 1). Each of the Ei is caused with probability ϵi.
(Go(Right,t) : ⅓) ∨ (Go(Straight,t) : ⅓) ∨ (Go(Left,t): ⅓) ← At(p,t) ∧ FourWay(p).
(Go(Left,t) : ½) ∨ (Go(Straight, t) : ½) ← At(p,t) ∧ Facing(d,t) ∧ LeftTurn(p). (Go(Right,t) : ½) ∨ (Go(Straight, t) : ½) ← At(p,t) ∧ Facing(d,t) ∧ RightTurn(p).
Go(Right,t) ← At(p,t) ∧ RightBend(p). Go(Straight,t) ← At(p,t) ∧ Straight(p).
At(to, t +1) ← At(from, t) ∧ Go(dir,t) ∧ Road(from,dir,to).
Facing(d2,t +1) ← Facing(d1,t) ∧ Go(Right,t) ∧ Next(d1,d2). Facing(d, t +1) ← Facing(d,t) ∧ Go(Straight,t).
Heading(East,0).
Road(1,N,2). Road(1,E,3). Road(2,N,4). Road(2,E,5). …
Road(x,W,y) ← Road(y,W,x).
FourWay(p) ← Road(p,N,_) ∧ Road(p,E,_) ∧ Road(p,S,_) ∧ Road(p,W,_).
Road(p,right,_). LeftTurn(p,d) ← ¬FourWay(p) ∧ Next(left,d) ∧ Road(p,left,_) ∧ Road(p,d,_). RightTurn(p,d) ← ¬FourWay(p) ∧ Next(d,right) ∧ Road(p,right,_) ∧ Road(p,d,_).
RightBend(p,d) ← ¬FourWay(p) ∧ ¬ThreeJunction(p) ∧ Next(d,right) ∧ Road(p,right,_). Straight(p,d) ← ¬FourWay(p) ∧ ¬ThreeJunction(p) ∧ Road(p,d,_).
CP-theory Instance 1 Instance n
(a : α) ∨ (b : β) ← φ. (c : γ) ∨ (d : δ) ← ψ. (a : α) ∨ (b : β) ← φ. (c : γ) ∨ (d : δ) ← ψ. (a : α) ∨ (b : β) ← φ. (c : γ) ∨ (d : δ) ← ψ.
CP-theory Instance 1 Instance n
(a : α) ∨ (b : β) ← φ. (c : γ) ∨ (d : δ) ← ψ.
CP-theory Instance 1 Instance n
(a : α) ∨ (b : β) ← φ. (c : γ) ∨ (d : δ) ← ψ.
World 1 World m
Query yes no yes … … … no
http://michaelgalloy.com/2013/06/11/cpu-vs-gpu-performance.html
Ground CP-theory
1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample
Results
1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample
Ground CP-theory Results
1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample 1 sample
I = {} Repeat: Find applicable rule Sample atom from head Add atom to I Until no more rules
Ground CP-theory Results
best
PITA 1 1 CVE 1 1 Problog 1 Problog MC Problog k-best MCINTYRE 1 OpenCL 2 or 3