Added normalization tests for negations.

These tests ensure that multiple negations are eliminated, negated
quantifiers are replaced appropriately, negations introduced by
reduction are correctly handled, and negated disjunctions and
conjunctions are replaced according to De Morgan’s rules.
This commit is contained in:
2017-11-15 18:53:43 +01:00
parent 9e9040cac0
commit 5621820fe4
2 changed files with 156 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
; tests that negations are correctly normalized
(define (domain test-normalization)
(:predicates
(test-predicate-0)
(test-predicate-1 ?x)
(test-predicate-2 ?x ?y))
; multiple negations
(:action test-action-1
:parameters
(?x)
:precondition
(not (not (not (not (not (not (test-predicate-1 ?x)))))))
:effect
(test-predicate-1 ?x))
; multiple negations
(:action test-action-2
:parameters
(?x)
:precondition
(not (not (not (not (not (test-predicate-1 ?x))))))
:effect
(test-predicate-1 ?x))
; negated “exists” statement
(:action test-action-3
:parameters
(?x)
:precondition
(not (exists
(?x ?y)
(not (not (test-predicate-2 ?x ?y)))))
:effect
(test-predicate-1 ?x))
; negated “forall” statement
(:action test-action-4
:parameters
(?x)
:precondition
(not (forall
(?x ?y)
(not (not (not (test-predicate-2 ?x ?y))))))
:effect
(test-predicate-1 ?x))
; negations introduced by reduction
(:action test-action-5
:parameters
(?x)
:precondition
(imply
(not (test-predicate-0))
(test-predicate-1 ?x))
:effect
(test-predicate-1 ?x))
; negated disjunction
(:action test-action-6
:parameters
(?x)
:precondition
(not (imply
(test-predicate-0)
(not (test-predicate-1 ?x))))
:effect
(test-predicate-1 ?x))
; negated conjunction
(:action test-action-7
:parameters
(?x)
:precondition
(not (and
(not (test-predicate-0))
(not (test-predicate-1 ?x))))
:effect
(test-predicate-1 ?x))
)