Module asp

This module provides some choice operators for answer set programming via forward chaining [10]. Since we use the (:-)/2 operator already for backward chaining rules, the operator (<=)/2 form the module "delta" needs to be used to write answer set programming rules. Take this example:

:- p, q, r.
{q} :- p.
{r} :- p.

This would need to be written as follows. For answer set programming constraints a forward chaining rule with a fail action is suggested. Further answer set programming ordinary facts and disjunctive facts need a start condition such as "init", which can then be used to produce an anwser set:

fail <= posted('p'), posted('q'), posted('r').
choose(['p','r']) <= posted(init).
choose(['q']) <= posted('p').
choose(['r']) <= posted('p').
?- post(init).

Our approach to answer set programming allows explicit mixing of forward chaining and backward chaining in that a forward chaining rule allows backward chaining goals in its condition part. The only predicate that this module currently provides is a choose/1 operator that allows satisfiability search.

The following answer set programming predicates are provided:

choose(L, G):
If a positive literal from L is already satisfied, the construct does nothing before further solving. Otherwise, the construct posts each positive literal from L via backtracking before further solving.