/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <bitset>
//#include <iomanip>
using namespace std;
int main()
{
int p=0b1100;
int q=0b1010;
// p==((~p)|q)
//https://www.matemaks.pl/metoda-zero-jedynkowa-dowodzenia-tautologii.html
cout<<"Tautologia: "<<boolalpha<<(bool)(p==((~p)|q))<<'\n';
cout<<"((~p)|q))"<<bitset<4>((~p)|q)<<endl;
// https://www.matemaks.pl/i-prawo-de-morgana.html
// (∼(p∧q))⇔((∼p)∨(∼q))
cout<<"Tautologia: "<<boolalpha<<(bool)((~(p&q))==((~p)|(~q)))<<'\n';
cout<<"((~(p&q))"<<bitset<4>(~(p&q))<<endl;
cout<<"((~p)|(~q))"<<bitset<4>((~p)|(~q))<<endl;
cout<<"//////////////////////////////////////////////////////////////"<<endl;
// [(¬∨)∨¬(∧)]
int lub=0b1110;
int i = 0b1000;
int wyrarzenie=((~lub)|(~(i)));
cout<<"[(¬∨)∨¬(∧)]=="<<bitset<4>(wyrarzenie)<<endl;
return 0;
}