Cody

# Problem 1484. Conjunctive Normal Form

Solution 2954965

Submitted on 16 Sep 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
Pvar={ [1 2], [-2 3 -4], [4 -5] }; Tval=[ 1 0 1 1 0 ]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

2   Fail
Pvar={ [1 2], [-2 3 4], [-4 5] }; Tval=[ 1 0 1 1 0 ]; y_correct=false; assert(isequal(CnfProp(Pvar,Tval),y_correct))

Assertion failed.

3   Pass
Pvar={ [1 2], [-2 3 -4], [4 -5] }; Tval=[ 0 1 1 0 0 ]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

4   Fail
Pvar={ [1 2] }; Tval=[0 0]; y_correct=false; assert(isequal(CnfProp(Pvar,Tval),y_correct))

Assertion failed.

5   Pass
Pvar={ [1 2] }; Tval=[0 1]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

6   Pass
Pvar={ [1 2] }; Tval=[1 0 ]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

7   Pass
Pvar={ [1 -2] }; Tval=[0 0]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

8   Pass
Pvar={ [1 2 3 4 ], [ 5 6 7 8] }; Tval=[1 0 0 0 1 0 0 0]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

9   Pass
Pvar={ [1 2 3 ], [ 4 5 6 ], [7 8 9], [10 11 -12] }; Tval=[1 0 0 0 1 0 0 0 1 0 0 0]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

10   Fail
Pvar={ [1 2 3 ], [ 4 5 6 ], [7 8 9], [10 11 12] }; Tval=[1 0 0 0 1 0 0 0 1 0 0 0]; y_correct=false; assert(isequal(CnfProp(Pvar,Tval),y_correct))

Assertion failed.

11   Pass
Pvar={ [1 2 3 ], [ -3 2 -1], [3 2 -4] [ 4 -2 -1] }; Tval=[1 0 0 0 ]; y_correct=true; assert(isequal(CnfProp(Pvar,Tval),y_correct))

12   Fail
Pvar={ [1 2 3 ], [ -3 2 -1], [3 2 -4] [ 4 -2 -1] }; Tval=[1 0 0 1 ]; y_correct=false; assert(isequal(CnfProp(Pvar,Tval),y_correct))

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!