Definite programs General programs
Negation in logic programming Summary
TDDD08 tutorial Włodzimierz Drabent
For TDDD08 Link¨
- ping University (Sweden)
Version 0.6 compiled on October 5, 2020
1 / 18 Definite programs General programs
Outline
◮ Negation and definite logic programs
◮ NAF, CWA ◮ Program completion
◮ General logic programs
◮ SLDNF-resolution (generalizing NAF) ◮ Generalizing CWA ◮ Stratified programs & standard models ◮ Stable model semantics 2 / 18 Definite programs General programs NAF, CWA comp(P )
Programs do not have any negative consequences. But sometimes we need them. Ex.: Old example program Pf on family relations. We would like to derive ¬child(a, b) when Pf | = child(a, b). Two approaches
- 1. CWA (closed world assumption)
P ⊢CWA ¬A whenever P | = A
i.e. MP | = ¬A (A – ground atom)
- 2. NAF (negation as finite failure)
(A – atom)
P ⊢NAF ¬A whenever P | = A and an SLD-tree for A is finite
(finitely failed tree)
3 / 18 Definite programs General programs NAF, CWA comp(P )
Difference CWA, NAF
Ex.: P = { p ← p } P ⊢CWA ¬p P ⊢NAF ¬p
4 / 18