The CHR-based Implementation of the SCIFF Abductive System - PowerPoint PPT Presentation

About This Presentation
Title:

The CHR-based Implementation of the SCIFF Abductive System

Description:

Marco Gavanelli Universit di Ferrara, Italy Marco Alberti Universidade nova de Lisboa, Portugal Evelina Lamma Universit di Ferrara, Italy – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 29
Provided by: Mar5419
Category:

less

Transcript and Presenter's Notes

Title: The CHR-based Implementation of the SCIFF Abductive System


1
The CHR-based Implementation of the
SCIFFAbductive System
  • Marco Gavanelli Università di Ferrara, Italy
  • Marco Alberti Universidade nova de Lisboa,
    Portugal
  • Evelina Lamma Università di Ferrara, Italy

2
Abductive Logic Programming
  • ALP lt KB, A, IC gt
  • KB logic program (set of clauses)
  • A atoms without definitions, can be assumed
  • IC Integrity constraints (usually,
    implications)
  • KB ? ? - G KB ? ? - IC
  • Reasoning from effects to causes

3
Diagnosis
  • headache- flu.
  • headache- period.
  • headache- hangover.
  • flu, vaccine -gt false.
  • hangover -gt drank.
  • period, sex(male) -gt false.
  • ?- headache.
  • Yes, flu More?
  • Yes, period

4
Event Calculus
  • holdsat(Fluent,Time)- initially(Fluent),
    not(clipped(0,Fluent,Time)).
  • holdsat(Fluent,Time)- initiates(Action,Fluent),
  • happens(Action,T1), not(clipped(T1,Fluent,Time)).
  • clipped(T1,Fluent,T2)- terminates(Action),
    happens(Action,T), T1ltTltT2.
  • initially(f1). initially(f2).

happens(c,7)
happens(a,2)
happens(b,4)
5
Abductive Event Calculus
  • holdsat(Fluent,Time)- initially(Fluent),
    not(clipped(0,Fluent,Time)).
  • holdsat(Fluent,Time)- initiates(Action,Fluent),
  • happens(Action,T1), not(clipped(T1,Fluent,Time)).
  • clipped(T1,Fluent,T2)- terminates(Action),
    happens(Action,T), T1ltTltT2.
  • initially(f1). initially(f2).

happens(c,7)
happens(a,2)
happens(b,4)
?

6
Sound negation
  • p(1).
  • p(f(X))- q(X).
  • q(2).
  • ?- not(p(Y)).
  • yes, Y\1, Y\f(2)

7
Abduction constraint solvingKowalski, Toni,
Wetzel 98
  • headache - flu.
  • headache - hangover.
  • flu, vaccine -gt false

Constraint Store
?- , headache.
vaccine
Constraint Solver
flu
fail
8
Abduction constraint solvingKowalski, Toni,
Wetzel 98
  • headache - flu.
  • headache - hangover.
  • headache - period.
  • flu, vaccine -gt false.
  • hangover -gt drank.
  • period, sex(male) -gt false.

Constraint Store
Constraint Solver
?- , headache.
vaccine
fail
flu
9
Constraint Handling Rules (CHR)
  • Declarative language for defining constraint
    solvers
  • Simplification rules
  • c1, c2, ..., cn ltgt guard body
  • activated if some constraints in the store match
    with c1, c2, ..., cn and guard is true
  • removes c1, c2, ..., cn from the store and
    executes body
  • Propagation rules
  • c1, c2, ..., cn gt guard body
  • activated if some constraints in the store match
    with c1, c2, ..., cn and guard is true
  • executes body

10
Example leq (less or equal)
  • reflexivity_at_ leq(X,X) ltgt true.
  • antisymmetry_at_ leq(X,Y), leq(Y,X) ltgt XY.
  • transitivity_at_ leq(X,Y), leq(Y,Z) gt leq(X,Z).

leq(A,B), leq(B,C), leq(C,A)
leq(A,B), leq(B,C), leq(C,A), leq(A,C)
leq(A,B), leq(B,A), AC
AB, AC
11
Abduction in CHR Abdennadher, Christiansen,
Dahl
  • Abducibles mapped to CHR constraints
  • headache - flu.
  • headache - hangover.
  • flu, vaccine -gt false

12
Abduction in CHR
  • headache - flu.
  • headache - ...
  • flu, vaccine gt false

Constraint Store
?- , headache.
vaccine
fail
flu
13
Abduction in CHR
  • headache - hangover.
  • headache - ...
  • drank.
  • hangover gt drank

Constraint Store
?- headache.
hangover
drank
success
14
Abduction in CHR
  • headache - period.
  • headache - ...
  • sex(male).

Constraint Store
  • period, sex(male) gt false

! CHR invalid syntax "sex(male)" ! Undeclared
constraint sex/1 in head of rule
15
Problem
16
Operational semantics
  • Propagation
  • a(X) a(Y), b -gt c (XY, b) -gt c
  • Case analysis
  • (XY, b) -gt c XY, (b -gt c) \/ X\Y
  • Equality rewriting
  • p(A,B,C)p(D,E,F) AD, BE, CF
  • Unfolding
  • p(X) -gt Goal p(X)- a. p(X)-b.
  • a -gt Goal. b -gt Goal
  • ...
  • Constraint solving

17
Abduction in CHR (SCIFF)
Constraint Store
  • headache - flu.
  • headache - ...

ic( )
vaccine, flu -gt false
?- , headache.
vaccine
fail
flu
18
Abduction in CHR (SCIFF)
Constraint Store
  • headache - flu.
  • headache - ...

ic( flu -gt false)
ic( )
vaccine, flu -gt false
?- , headache.
vaccine
fail
flu
19
Transitions
  • Propagation transition ( case analysis)
  • abd(X), ic(abd(Y)Rest-gt Head)
  • gt
  • copy(ic(abd(Y) Rest -gt Head) ,
  • ic(abd(Y)Rest-gt Head)),
  • reif_unify(X,Y,Boolean),
  • ( Boolean1, ic(Rest-gtHead)
  • Boolean0).

20
Transitions
  • Propagation transition ( case analysis)
  • abd(X), ic(abd(Y)Rest-gt Head)
  • gt
  • copy(ic(abd(Y) Rest -gt Head) ,
  • ic(abd(Y)Rest-gt Head)),
  • reif_unify(X,Y,Boolean),
  • ( Boolean1, ic(Rest-gtHead)
  • Boolean0).

ic(abd(vaccine),abd(flu)-gt false)
ic(abd(period),sex(male)-gt false)
ic(abd(hangover)-gt drank)
abd(hangover)
21
No hashing
  • Does not use CHRs hashing
  • Solution abducibles are represented with
    redundant information
  • abd(Functor, Arity, Atom)
  • So to abduce atom X
  • abd(X)- functor(F, A, X),
  • abd(F, A, X).
  • E.g., if I abduce atom mother(X,john), the
    constraint store contains
  • abd(mother, 2, mother(X,john))

22
Hashing
  • Propagation transition ( case analysis)
  • abd(F,A,X), ic(abd(F,A,Y)Rest-gt Head)
  • gt
  • copy(ic(abd(Y) Rest -gt Head) ,
  • ic(abd(Y)Rest-gt Head)),
  • reif_unify(X,Y,Boolean),
  • ( Boolean1, ic(Rest-gtHead)
  • Boolean0).

Requires the first two arguments identical
23
Hashing
  • Propagation transition ( case analysis)
  • abd(F,A,X), ic(abd(F,A,Y)Rest-gt Head)
  • gt
  • copy(ic(abd(Y) Rest -gt Head) ,
  • ic(abd(Y)Rest-gt Head)),
  • reif_unify(X,Y,Boolean),
  • ( Boolean1, ic(Rest-gtHead)
  • Boolean0).

ic(abd(vaccine,1,vaccine),abd(flu,1,flu)-gt
false)
ic(abd(period,1,period),sex(male)-gt false)
ic(abd(hangover,1,hangover)-gt drank)
abd(hangover,1,hangover)
24
Postpone choices
  • new CHR constraint
  • nondeterministic(Goal)
  • says that Goal can open a choice point, so
    should be called as late as possible.
  • Two phases, declared by a CHR constraint phase/1
  • phase(deterministic) only deterministic goals
    are executed
  • phase(nondeterministic) exactly ONE
    nondeterministic goal can be executed
  • switch2det _at_ phase(nondeterministic),
    nondeterministic(G) ltgt
  • call(G), phase(deterministic).
  • switch2nondet _at_ phase(deterministic) ltgt
    phase(nondeterministic)

25
Postponing nondet.
  • Propagation transition ( case analysis)
  • abd(F,A,X), ic(abd(F,A,Y)Rest-gt Head)
  • gt
  • copy(ic(abd(Y) Rest -gt Head) ,
  • ic(abd(Y)Rest-gt Head)),
  • reif_unify(X,Y,B),
  • ( B1, ic(Rest-gtHead)
  • B0).

26
Postponing nondet.
  • Propagation transition ( case analysis)
  • abd(F,A,X), ic(abd(F,A,Y)Rest-gt Head)
  • gt
  • copy(ic(abd(Y) Rest -gt Head) ,
  • ic(abd(Y)Rest-gt Head)),
  • reif_unify(X,Y,B),
  • (B 1 -gt ic(Rest, Head)
  • B 0 -gt true
  • nondeterministic((B1,ic(Rest,Head))
    B0))
  • ).

27
Results
Experiment SCIFF 2005 SCIFF 2011
Auction protocol 2.27 s 0.37 s
Block world 45.0 s 15.7 s
AlLoWS Feeble Conformance 84.4 s 36.8 s
AlLoWS non-conformant 3.7 s 3.3 s
28
Conclusions
  • CHR implementation of an abductive
    proof-procedure
  • Sound, complete, sound treatment of negation
  • Well integrated with constraint solving, CLP(FD),
    CLP(R), universally quantified variables,
    quantifier restrictions, etc.
  • Easy to extend for other features (see other talk
    after coffee break)

29
Thank you for your attention!
  • Questions?
Write a Comment
User Comments (0)
About PowerShow.com