Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 16 / Source.cpp
diff options
context:
space:
mode:
Commitd489848bab395aea447bf6fe462f7c4f603dee1a (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2021-06-12 17:01:20 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2021-06-12 17:01:20 +0300
Files1bf68497f483098888dc1f94eadbf1d50894569a /Sem. 16/Source.cpp
Object-oriented_programming_FMI-d489848bab395aea447bf6fe462f7c4f603dee1a.tar
Object-oriented_programming_FMI-d489848bab395aea447bf6fe462f7c4f603dee1a.tar.gz
Object-oriented_programming_FMI-d489848bab395aea447bf6fe462f7c4f603dee1a.zip
Parentd060147c32ecebaecb31cf5a93aae75318dc7ca6 (diff)
sem 16
1 files changed, 15 insertions, 0 deletions
-rw-r--r--Sem. 16/Source.cpp15
diff --git a/Sem. 16/Source.cpp b/Sem. 16/Source.cpp
new file mode 100644
index 0000000..2b810b8
--- /dev/null
+++ b/Sem. 16/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