Useful Features

In this section, we will use a slightly bigger example - shopping trips planning - to introduce some useful features of the abductive system, including the usage of arithmetic constraints, the options of grounding answers and computing minimal explanations, the specification of argument types for abducibles, and the stand alone inequality solver.

The example (from [4]) is a planning problem where we need to plan a trip to buy certain items. We assume in the background knowledge we have information about the places from which the items can be bought. There are two actions - go to a particular place or buy an item from a place. The example is modelled using a simplified version of the Event Calculus (SEC):

% --------- Shopping Trips Planning ----------
% ++++++++++++++++++++++++++++++++++++++++++++

% ------------- abducibles declaration ------

abducible(happens(_,_)).

% -------------- background knowledge --------

time(T) :-
  T in 0..8.

% Simplified Event Calculus domain indpendent axioms

holds(F, T) :-
  time(T),
  initially(F),
  \+ clipped(0, F, T). 

holds(F, T) :-
  time(T1), time(T),
  0 #< T1, T1 #< T,
  happens(A, T1),
  initiates(A, F, T1),
  \+ clipped(T1, F, T). 

clipped(T1, F, T) :-
  time(T1), time(T), time(T2), 
  T1 #< T2, T2 #< T,
  happens(A, T2),
  terminates(A, F, T2).

% action effect conditions

initiates(goto(X), at(X), T) :- place(X).
terminates(goto(X), at(Y), T) :- place(X), place(Y), X =/= Y.

initiates(buy(Item, Place), have(Item), T) :-
  sells(Place, Item, _Cost), holds(at(Place), T). 
initiates(buy(Item, Place), balance=B, T) :-
  sells(Place, Item, _Cost), holds(at(Place), T), 
  holds(balance=B0, T), 
  sells(Place, Item, Cost),
  {B = B0 - Cost}.
terminates(buy(Item, Place), balance=_, T).

% initial state and static facts

initially(balance=50.00).

sells(hws, drill, 34.99).
sells(sm, milk, 1.05).
sells(sm, banana, 2.45).

place(hws).
place(sm).

% ------------- integrity constraints -----------

% concurrent actions not allowed
ic :- happens(E1, T), happens(E2, T), E1 =/= E2.



Subsections

Jiefei Ma 2011-02-14