blob: 2b810b8725bf71b10a41bae21bc65f3a3e0d03be (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include "LogicExpressions/LogicExpr.h"
using namespace LogicExpressions;
int main()
{
LogicExpr* expr = new Operation(new Var('p'), '|', new Negation(new Var('p'))); // p & !p
expr->print();
cout << " " << isTautology(expr, { 'p' }) << endl;
LogicExpr* expr2 = new Operation(new Var('q'),'^',new Operation(new Var('p'), '^', new Negation(new Var('p')))); // q ^ (p ^ !p)
expr2->print();
cout << " " << isContradiction(expr2, { 'p', 'q' });
}
|