This repository formalises some aspects of the logic of here-and-there and Answer Set Programming (ASP) in Agda.
The formalisation currently encompasses three main topics:
- Logic programs as a normal form of the logic of here-and-there
- Connections between the logic of here-and-there and ASP (equilibrium models and strong equivalence)
- Equivalence of stable models using the reduct operation (for propositional theories) and equilibrium models
See the module structure below for more details. See the bibliography for references used to develop this formalisation.
- definition of formulas and theories
- definition of special formulas (i.e. different kinds of logic programs)
- definition of languages
- classical interpretations and model relation
- proofs of some tautologies
- restricting interpretation ot languages
- here-and-there interpretations and model relation
- proofs of simple properties, equivalences, and tautologies
- equivalence of theories and logic programs
- restricting interpretations to languages
Equilibrium
- definition of equilibrium models
- definition of strong equivalence
- ht equivalence implies strong equivalence
AnswerSet
- definition of reduct
- definition of answer sets using reducts
- equivalence to equilibrium models
NatHelper
- helper theorems on natural numbers
FunctionHelper
- some simple helper theorems for type theoretic constructions
Cabalar, P., & Ferraris, P. (2007). Propositional theories are strongly equivalent to logic programs. Theory and Practice of Logic Programming, 7(6), 745-759. doi:10.1017/S1471068407003110
Ferraris, P. (2005). Answer Sets for Propositional Theories. Logic Programming and Nonmonotonic Reasoning (Vol. 3662, pp. 119–131). doi:10.1007/11546207_10
Lifschitz, V., Tang, L.R. & Turner, H. (1999). Nested expressions in logic programs. Annals of Mathematics and Artificial Intelligence 25, 369–389. doi:10.1023/A:1018978005636
Lifschitz, V., Pearce, D., & Valverde, A. (2001). Strongly equivalent logic programs. ACM Transactions on Computational Logic, 2(4), 526–541. doi:10.1145/383779.383783
Pearce, D. (1997). A new logical characterisation of stable models and answer sets. Non-Monotonic Extensions of Logic Programming (Vol. 1216, pp. 57–70). doi:10.1007/BFb0023801
The code is tested on Agda version 2.7.0.1.
This formalisation makes use of many Unicode symbols for defining operations/relations using standard notations. A list of (most) symbols is available together with how to write them using the Agda input mode.
The standard library of Agda provides many common type theoretic constructions. While these constructions are generally well-known their Agda specific syntax may not be as well-known. Therefore we reproduce their types below for easy reference. For full details of these constructions check the standard library.
[ _ , _ ] : {A B C : Set} → (A → C) → (B → C) → A ⊎ B → C< _ , _ > : {A B C : Set} → (A → B) → (A → C) → A → B × Csubst : {A : Set} → (P : A → Set) → {x y : A} → x ≡ y → P x → P ymap : {A B C D : Set} → (A → C) → (B → D) → A × B → C × DSome other common constructions that are not part of the standard library are included in the module FunctionHelper.