Cody

Solution 1953578

Submitted on 30 Sep 2019
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
x = '0'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = 0

2   Pass
x = '1'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = 1

3   Pass
x = 'A'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = 0

4   Pass
x = '~A'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = 0

5   Pass
x = 'A|1'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = 1

6   Pass
x = '1&A'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = 0

7   Fail
x = 'A|B'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = []

Assertion failed.

8   Fail
x = 'A&B'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = []

Assertion failed.

9   Pass
x = 'A|A'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = 0

10   Pass
x = 'A|~A'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = 1

11   Pass
x = '0==0'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = 1

12   Pass
x = '~0'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = 1

13   Fail
x = '~(A & B) == (~A | ~B)'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = []

Assertion failed.

14   Fail
x = '~(Z & Y) == (~Y | ~Z)'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = []

Assertion failed.

15   Fail
x = 'A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|X|V|W|Y|Z'; y_correct = false; assert(isequal(tautology(x),y_correct))

ans = []

Assertion failed.

16   Fail
x = 'A|B|C|D|E|F|G|H|I|J|K|L|M|~A|O|P|Q|R|S|T|U|X|V|W|Y|Z'; y_correct = true; assert(isequal(tautology(x),y_correct))

ans = []

Assertion failed.

17   Fail
assert(isequal(tautology('(A|B)|C'),false));

ans = []

Assertion failed.

18   Fail
assert(isequal(tautology('(A|B)|(C == C)'),true));

ans = []

Assertion failed.

19   Fail
assert(isequal(tautology('(A == B)|(B == C)|(C == A)'),true));

ans = []

Assertion failed.

20   Pass
assert(isequal(tautology('~(~(~(~(~(~(0))))))'),false));

ans = 0

21   Fail
assert(isequal(tautology('~(~(~(~(~(~(~0))))))'),true)); % provided by Alfonso: assert(isequal(tautology('((0&1)|~B)&~B'),false));

ans = 1 ans = []

Assertion failed.

22   Fail
assert(isequal(tautology('((0&~B)&~B)'),false));

ans = []

Assertion failed.

23   Pass
assert(isequal(tautology('((0|A)&~A)'),false));

ans = 0

24   Pass
assert(isequal(tautology('((0|A)|1)'),true));

ans = 1

25   Fail
assert(isequal(tautology('((0|~B)|1)'),true));

ans = []

Assertion failed.

26   Fail
assert(isequal(tautology('((1&0)|B)'),false));

ans = []

Assertion failed.

27   Pass
assert(isequal(tautology('((1&1)&A)'),false));

ans = 0

28   Pass
assert(isequal(tautology('((1|0)|A)'),true));

ans = 1

29   Pass
assert(isequal(tautology('((1|A)|0)'),true));

ans = 1

30   Fail
assert(isequal(tautology('((1|~A)&B)'),false));

ans = []

Assertion failed.

31   Pass
assert(isequal(tautology('((A&1)|~A)|A'),true));

ans = 1

32   Fail
assert(isequal(tautology('((A&~A)&~B)|~A'),false));

ans = []

Assertion failed.

33   Fail
assert(isequal(tautology('((A&~B)&1)|B'),false));

ans = []

Assertion failed.

34   Fail
assert(isequal(tautology('((A|0)&1)&~B'),false));

ans = []

Assertion failed.

35   Pass
assert(isequal(tautology('((A|A)&A)|~A'),true));

ans = 1

36   Fail
assert(isequal(tautology('((B|0)&B)'),false));

ans = []

Assertion failed.

37   Fail
assert(isequal(tautology('((B|1)&B)&A'),false));

ans = []

Assertion failed.

38   Fail
assert(isequal(tautology('((B|A)|~A)'),true));

ans = []

Assertion failed.

39   Fail
assert(isequal(tautology('((~A&~A)&0)&B'),false));

ans = []

Assertion failed.

40   Pass
assert(isequal(tautology('((~A&~A)|0)'),false));

ans = 0

41   Pass
assert(isequal(tautology('((~A&~A)|~A)|1'),true));

ans = 1

42   Fail
assert(isequal(tautology('((~A|A)|~B)&1'),true));

ans = []

Assertion failed.

43   Fail
assert(isequal(tautology('((~A|B)|A)'),true));

ans = []

Assertion failed.

44   Pass
assert(isequal(tautology('((~A|~A)|1)'),true));

ans = 1

45   Fail
assert(isequal(tautology('((~A|~B)&0)'),false));

ans = []

Assertion failed.

46   Fail
assert(isequal(tautology('((~B&0)&A)'),false));

ans = []

Assertion failed.

47   Pass
assert(isequal(tautology('(0&1)|1&1'),true));

ans = 1

48   Fail
assert(isequal(tautology('(0|~A&B)'),false));

ans = []

Assertion failed.

49   Pass
assert(isequal(tautology('(1|A&0)'),true));

ans = 1

50   Fail
assert(isequal(tautology('(A&A&~B)'),false));

ans = []

Assertion failed.

51   Pass
assert(isequal(tautology('(A&~A|1)'),true));

ans = 1

52   Fail
assert(isequal(tautology('(A|1)|B'),true));

ans = []

Assertion failed.

53   Pass
assert(isequal(tautology('(A|A)|A|1'),true));

ans = 1

54   Fail
assert(isequal(tautology('(B&1)|~B'),true));

ans = []

Assertion failed.

55   Fail
assert(isequal(tautology('(B&~B)&~B&0'),false));

ans = []

Assertion failed.

56   Fail
assert(isequal(tautology('(B|~B)|B'),true));

ans = []

Assertion failed.

57   Fail
assert(isequal(tautology('(~A&B&0)'),false));

ans = []

Assertion failed.

58   Fail
assert(isequal(tautology('(~A|0)|~B&~A'),false));

ans = []

Assertion failed.

59   Pass
assert(isequal(tautology('(~A|1)|1'),true));

ans = 1

60   Fail
assert(isequal(tautology('(~A|B&B)'),false));

ans = []

Assertion failed.

61   Fail
assert(isequal(tautology('(~A|B)|~B'),true));

ans = []

Assertion failed.

62   Pass
assert(isequal(tautology('(~A|~A)|0'),false));

ans = 0

63   Fail
assert(isequal(tautology('(~B&0)&1|1'),true));

ans = []

Assertion failed.

64   Fail
assert(isequal(tautology('1&B|~B|0'),true));

ans = []

Assertion failed.

65   Fail
assert(isequal(tautology('B&1&A&1'),false));

ans = []

Assertion failed.

66   Pass
assert(isequal(tautology('~A&0&1|1'),true));

ans = 1

67   Fail
assert(isequal(tautology('~B&0&~A|B'),false));

ans = []

Assertion failed.

68   Fail
assert(isequal(tautology('~B|1|1|~B'),true));

ans = []

Assertion failed.

69   Fail
assert(isequal(tautology('~B|~B&1|1'),true));

ans = []

Assertion failed.

70   Pass
assert(isequal(tautology('A==~A'),false));

ans = 0

Suggested Problems

More from this Author41