Cody

# Problem 44374. Tautology

Solution 1319000

Submitted on 29 Oct 2017
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   Fail
x = '0'; y_correct = false; assert(isequal(tautology(x),y_correct))

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test1 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test2 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test3 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test4 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test5 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test6 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test7 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test8 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test9 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test10 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test11 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test12 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test13 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test14 (line 3) assert(isequal(tautology(x),y_correct))

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))

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test15 (line 3) assert(isequal(tautology(x),y_correct))

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))

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test16 (line 3) assert(isequal(tautology(x),y_correct))

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test17 (line 1) assert(isequal(tautology('(A|B)|C'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test18 (line 1) assert(isequal(tautology('(A|B)|(C == C)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test19 (line 1) assert(isequal(tautology('(A == B)|(B == C)|(C == A)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test20 (line 1) assert(isequal(tautology('~(~(~(~(~(~(0))))))'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test21 (line 1) assert(isequal(tautology('~(~(~(~(~(~(~0))))))'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test22 (line 1) assert(isequal(tautology('((0&~B)&~B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test23 (line 1) assert(isequal(tautology('((0|A)&~A)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test24 (line 1) assert(isequal(tautology('((0|A)|1)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test25 (line 1) assert(isequal(tautology('((0|~B)|1)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test26 (line 1) assert(isequal(tautology('((1&0)|B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test27 (line 1) assert(isequal(tautology('((1&1)&A)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test28 (line 1) assert(isequal(tautology('((1|0)|A)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test29 (line 1) assert(isequal(tautology('((1|A)|0)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test30 (line 1) assert(isequal(tautology('((1|~A)&B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test31 (line 1) assert(isequal(tautology('((A&1)|~A)|A'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test32 (line 1) assert(isequal(tautology('((A&~A)&~B)|~A'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test33 (line 1) assert(isequal(tautology('((A&~B)&1)|B'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test34 (line 1) assert(isequal(tautology('((A|0)&1)&~B'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test35 (line 1) assert(isequal(tautology('((A|A)&A)|~A'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test36 (line 1) assert(isequal(tautology('((B|0)&B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test37 (line 1) assert(isequal(tautology('((B|1)&B)&A'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test38 (line 1) assert(isequal(tautology('((B|A)|~A)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test39 (line 1) assert(isequal(tautology('((~A&~A)&0)&B'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test40 (line 1) assert(isequal(tautology('((~A&~A)|0)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test41 (line 1) assert(isequal(tautology('((~A&~A)|~A)|1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test42 (line 1) assert(isequal(tautology('((~A|A)|~B)&1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test43 (line 1) assert(isequal(tautology('((~A|B)|A)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test44 (line 1) assert(isequal(tautology('((~A|~A)|1)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test45 (line 1) assert(isequal(tautology('((~A|~B)&0)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test46 (line 1) assert(isequal(tautology('((~B&0)&A)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test47 (line 1) assert(isequal(tautology('(0&1)|1&1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test48 (line 1) assert(isequal(tautology('(0|~A&B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test49 (line 1) assert(isequal(tautology('(1|A&0)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test50 (line 1) assert(isequal(tautology('(A&A&~B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test51 (line 1) assert(isequal(tautology('(A&~A|1)'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test52 (line 1) assert(isequal(tautology('(A|1)|B'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test53 (line 1) assert(isequal(tautology('(A|A)|A|1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test54 (line 1) assert(isequal(tautology('(B&1)|~B'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test55 (line 1) assert(isequal(tautology('(B&~B)&~B&0'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test56 (line 1) assert(isequal(tautology('(B|~B)|B'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test57 (line 1) assert(isequal(tautology('(~A&B&0)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test58 (line 1) assert(isequal(tautology('(~A|0)|~B&~A'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test59 (line 1) assert(isequal(tautology('(~A|1)|1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test60 (line 1) assert(isequal(tautology('(~A|B&B)'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test61 (line 1) assert(isequal(tautology('(~A|B)|~B'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test62 (line 1) assert(isequal(tautology('(~A|~A)|0'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test63 (line 1) assert(isequal(tautology('(~B&0)&1|1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test64 (line 1) assert(isequal(tautology('1&B|~B|0'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test65 (line 1) assert(isequal(tautology('B&1&A&1'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test66 (line 1) assert(isequal(tautology('~A&0&1|1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test67 (line 1) assert(isequal(tautology('~B&0&~A|B'),false));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test68 (line 1) assert(isequal(tautology('~B|1|1|~B'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test69 (line 1) assert(isequal(tautology('~B|~B&1|1'),true));

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

Undefined variable "freepass" or class "freepass.please". Error in tautology (line 2) freepass.please; Error in Test70 (line 1) assert(isequal(tautology('A==~A'),false));