First, we need to encode the problem in an abductive theory source file, suppose. An abductive theory has three parts: the background knowledge, the abducible predicates and the integrity constraints.
The background knowledge is a set of Prolog clauses (either rules or facts), e.g.,
car_doesnt_start(X) :- battery_flat(X). car_doesnt_start(X) :- has_no_fuel(X). lights_go_on(mycar). fuel_indicator_empty(mycar).
The integrity constraints are Prolog rules with the head being ic, e.g.,
ic :- battery_flat(X), lights_go_on(X). ic :- has_no_fuel(X), \+ fuel_indicator_empty(X), \+ broken_indicator(X).
Note that negation is written as the same as the Prolog negation, i.e., atom preceded by the Prolog's not operator -
.
An abductive predicate is declared using abducible/1, e.g.,
abducible(battery_flat(_)). abducible(has_no_fuel(_)). abducible(broken_indicator(_)).