This solution is outdated. To rescore this solution, sign in.
Test  Status  Code Input and Output 

1  Pass 
x = '0';
y_correct = false;
assert(isequal(tautology(x),y_correct))

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

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

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

5  Pass 
x = 'A1';
y_correct = true;
assert(isequal(tautology(x),y_correct))

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

7  Pass 
x = 'AB';
y_correct = false;
assert(isequal(tautology(x),y_correct))

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

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

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

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

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

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

14  Fail 
assert(isequal(tautology('(AB)C'),false));

15  Fail 
assert(isequal(tautology('(AB)(C == C)'),true));

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

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

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

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

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

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

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

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

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

25  Fail 
assert(isequal(tautology('((10)A)'),true));

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

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

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

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

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

31  Fail 
assert(isequal(tautology('((A0)&1)&~B'),false));

32  Fail 
assert(isequal(tautology('((AA)&A)~A'),true));

33  Fail 
assert(isequal(tautology('((B0)&B)'),false));

34  Fail 
assert(isequal(tautology('((B1)&B)&A'),false));

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

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

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

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

39  Fail 
assert(isequal(tautology('((~AA)~B)&1'),true));

40  Fail 
assert(isequal(tautology('((~AB)A)'),true));

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

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

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

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

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

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

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

48  Fail 
assert(isequal(tautology('(A&~A1)'),true));

49  Fail 
assert(isequal(tautology('(A1)B'),true));

50  Fail 
assert(isequal(tautology('(AA)A1'),true));

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

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

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

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

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

56  Fail 
assert(isequal(tautology('(~A1)1'),true));

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

58  Fail 
assert(isequal(tautology('(~AB)~B'),true));

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

60  Fail 
assert(isequal(tautology('(~B&0)&11'),true));

61  Fail 
assert(isequal(tautology('1&B~B0'),true));

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

63  Fail 
assert(isequal(tautology('~A&0&11'),true));

64  Pass 
assert(isequal(tautology('~B&0&~AB'),false));

65  Pass 
assert(isequal(tautology('~B11~B'),true));

66  Pass 
assert(isequal(tautology('~B~B&11'),true));

709 Solvers
775 Solvers
Flip the main diagonal of a matrix
401 Solvers
366 Solvers
307 Solvers