Answer Set Programming (clingo) for policies
What it is
Answer Set Programming (ASP) is logic programming under the stable model semantics (Gelfond and Lifschitz, 1988). A program has zero, one or many answer sets, each a consistent set of beliefs. clingo, from the Potassco group at Potsdam, is the standard solver. In policy work ASP is used mainly as an analysis engine, not as the language owners write.
Model
- Entities: any, as in Datalog.
- Rule forms: normal rules with default negation (
not p), strong (classical) negation (-p), disjunctive heads, choice rules ({a; b}.), integrity constraints (:- a, b.), aggregates, and weak constraints for optimisation (:~ ...). - Combining: whatever the program states. Defaults with exceptions are natural:
permit :- role(x), not exception(x). - Default: closed world through default negation, unless strong negation is used to keep "false" and "unknown" apart.
Formal semantics and what is proved
- Stable model semantics. Stratified programs have exactly one answer set (the perfect model), so they coincide with stratified Datalog.
- Complexity (propositional): deciding whether a normal program has an answer set is NP-complete; with disjunction it is Σ2P-complete. For programs with variables, grounding can blow up.
- Uses in policy analysis: XACML 3.0 translated to ASP with a proved correspondence and a unique answer set (Ramli, Nielson, Nielson); detection of incompleteness, conflicts and unreachable rules (Ramli 2015); XACML2ASP for verification and comparison (COMPSAC 2010); Rezvani et al. (International Journal of Information Security 2019) built a clingo-based XACML analyser and report better performance than earlier tools.
Purpose and use case
Not built in.
Uncertainty
Not probabilistic. But ASP can represent several possible readings as several answer sets (choice rules), and ask questions across them: is the request allowed in all (cautious reasoning) or in some (brave reasoning) of them. Probabilistic extensions exist (LP^MLN, P-log, plingo); we have not evaluated them.
History and state
None built in. Temporal extensions exist (telingo).
What we can reuse
- clingo as the analyser for questions that need search: "is there any request that this rule set allows and that crosses a boundary", "which smallest set of approvals would make this allowed" (abduction, useful for "ask whom").
- Cautious versus brave reasoning across possible readings: allow only if allowed in every reading, ask if allowed in some, deny if in none. A qualitative version of the probabilistic layer that needs no numbers.
- Weak constraints to pick the weakest sufficient form.
What it lacks for us
- Several answer sets are confusing as a decision semantics for owners. Decisions should stay in the unique-model (stratified) fragment.
- Grounding cost; no fixed algebra; no forms, history or proofs of the engine.
Key references
- Gelfond, Lifschitz, "The stable model semantics for logic programming", ICLP/SLP 1988.
- Gebser, Kaminski, Kaufmann, Schaub, "Answer Set Solving in Practice", Morgan and Claypool 2012; clingo: https://potassco.org/clingo/
- Ramli, Nielson, Nielson, "XACML 3.0 in Answer Set Programming". https://arxiv.org/abs/1206.5327
- Ramli, "Detecting Incompleteness, Conflicting and Unreachability XACML Policies using Answer Set Programming", 2015. https://arxiv.org/abs/1503.02732
- Rezvani, Rajaratnam, Ignjatovic, Pagnucco, "Analyzing XACML policies using answer set programming", International Journal of Information Security 2019. https://doi.org/10.1007/s10207-018-0421-5
- Ahn et al., "Representing and reasoning about web access control policies" (XACML2ASP), COMPSAC 2010. https://cse.buffalo.edu/~hongxinh/papers/COMPSAC10.pdf