From 9603d0847a01c555c2c9286294b3ccdea3e38be8 Mon Sep 17 00:00:00 2001 From: angeld55 Date: Sat, 12 Jun 2021 18:30:23 +0300 Subject: sem 16 --- Sem. 16/LogicExpressions/Source.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Sem. 16/LogicExpressions/Source.cpp (limited to 'Sem. 16/LogicExpressions/Source.cpp') diff --git a/Sem. 16/LogicExpressions/Source.cpp b/Sem. 16/LogicExpressions/Source.cpp new file mode 100644 index 0000000..2b810b8 --- /dev/null +++ b/Sem. 16/LogicExpressions/Source.cpp @@ -0,0 +1,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' }); +} \ No newline at end of file -- cgit v1.3.1-23-gd82d