]> gitweb.factorcode.org Git - factor.git/blob - extra/boolean-expr/boolean-expr-tests.factor
boolean-expr: add some more expression simplification rules
[factor.git] / extra / boolean-expr / boolean-expr-tests.factor
1 ! Copyright (C) 2022 Alexander Ilin.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: boolean-expr literals tools.test ;
4 IN: boolean-expr.tests
5
6 ${ P ¬ Q ⋀ } [ P ¬ P Q ⋁ ⋀ ] unit-test
7 ${ P ¬ Q ⋀ } [ P ¬ Q P ⋁ ⋀ ] unit-test
8 ${ P Q ⋀ } [ P P ¬ Q ⋁ ⋀ ] unit-test
9 ${ P Q ⋀ } [ P Q P ¬ ⋁ ⋀ ] unit-test
10
11 ! The following tests can't pass because only the distributivity of ∧ over ∨ is
12 ! implemented, but not the other way around, to prevent infinite loops.
13 ! ${ P ¬ Q ⋀ } [ P ¬ P Q ⋀ ⋁ ] unit-test
14 ! ${ Q P ¬ ⋀ } [ P ¬ Q P ⋀ ⋁ ] unit-test
15 ! ${ P Q ⋀ } [ P P ¬ Q ⋀ ⋁ ] unit-test
16 ! ${ P Q ⋀ } [ P Q P ¬ ⋀ ⋁ ] unit-test