Abductive Constraint Logic Programming
A single-file abduction system for prolog. Doesn't need/use CHR for abduction.
Tested with SWI, Trealla, Scryer, and Tau:
?- [alp_int].
Warning: singleton: RestOfLiterals, near alp_int:160
Warning: singleton: RestOfLiterals, near alp_int:169
Warning: singleton: Y, near alp_int:177
Warning: singleton: Z, near alp_int:178
true.
?- [alp_prof_ex].
true.
?- demo([professor(henning)], [], FinalExp).
FinalExp = [not(rich(henning)),professor(henning)]
; false.
?- demo([happy(henning)], [], FinalExp).
FinalExp = [not(professor(henning)),rich(henning)]
; FinalExp = [has(henning,nice_students),not(rich(henning)),professor(henning)]
; false.
See more examples in alp_exp.pl
.
- Integrity constraints (
ic
) tell the abductive system what can't be true. For example, inalp_prof_ex
, you can't have a rich professor. - Abducibles tell the abductive system how to think about facts that it's seeing
for the first time (open world). For example, in EX3 of
alp_exp
, if you ask about a new bird that isn'ttweety
orsam
, then the system will say that this new bird is eitherslim
orbird_ab
. Abducibles represent default logic.