发布网友 发布时间:2025-01-07 21:48
共1个回答
热心网友 时间:2025-01-16 02:34
A-Z + is OR * is AND _ is → # is⊕(圆圈里加个bai+) @ is ⊙
$ is ↑ 命题的"与非" 运算du( "与非门zhi" )
% 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]!='\0';i++)
stk.pop();
}
else break;
}
stk.push(temp);
break;
case '*':
while (!stk.empty())
//从键盘上任bai意输入一个主析取范式du,输出与之等值的zhi主合取范式。┐∧∨
# include <iostream>
# include <cmath>
# include <windows.h>
using namespace std ;
扩展资料:
(1)命题变项是命题公式。
(2)如果A是命题公式,则¬A是命题公式。
(3)如果A和B是命题公式,那么(A∧B)、(A∨B)、(A→B)和(A↔B)都是命题公式。
(4)当且仅当有限次地应用(1),(2),(3)所得到的包含命题变项,联结词和圆括号的符号串是命题公式。
命题公式的定义是一个递归定义形式。命题公式本身不是命题,没有真值,只有对其命题变项进行赋值后,它才有真值。
5个联结词运算儿有不同的优先级。当它们同时出现在一个命题公式里时,联结间运算的优先次序为、∧、∨、→、,如果有括号,则括号内的运算优先进行。
参考资料来源:百度百科-命题公式