範式c語言
Ⅰ c語言怎麼實現求謂詞公式的前束範式
有木有疼人的男生,~913
Ⅱ 用C語言編程:輸入命題公式的合式公式,求出公式的真值表,並輸出該公式的主合取範式和主析取範式
A-Z + is OR * is AND _ is → # is⊕(圓圈裡加個+) @ is ⊙
$ is ↑ 命題的"與非" 運算( "與非門" )
% is ↓ 命題的"或非"運算( "或非門" )
Input the source formula:
A*!S+R
NORMALc: (!A*!B*!R)+(A*!B*!R)+(!A*B*!R)+(A*B*!R)+(!A*!B*R)+(!A*B*R)+(A*B*R)
NORMALd (!A+B+!R)
Error!
Input the source formula:
A#B
Here!
4countTerms
NORMALc: (A*!B)+(!A*B)
NORMALd (A+B)*(!A+!B)
Error!
Input the source formula:
stack<char> stk;
bool isVar(char ch)const;
void addMin(int minterm);
void addMax(int maxterm);
bool compute(int minterm);
void getInversePoland();
int countTerms(int n);
void assign(int minterm);
stack<bool> boolStk;
public:
formulaBase();
formulaBase(const formulaBase& rhs);
~formulaBase();
void getSource();
cout<<"Invalid input !"
"Operate again:"<<endl;
cin>>sourceFormula;*/
}
void formulaBase::getInversePoland()
{
char temp,temp1;
for(int i=0;sourceFormula[i]!='