字典翻译 问答 其它 用C或C++编写程序,要求:输入命题公式,给出它的主合取范式和主析取范式.用C或C++编写程序,要求:输入命题公式,给出它的主合取范式和主析取范式.例如运行时,从键盘输入:p∧q∨r程序能根
问题标题:
用C或C++编写程序,要求:输入命题公式,给出它的主合取范式和主析取范式.用C或C++编写程序,要求:输入命题公式,给出它的主合取范式和主析取范式.例如运行时,从键盘输入:p∧q∨r程序能根
问题描述:

用C或C++编写程序,要求:输入命题公式,给出它的主合取范式和主析取范式.

用C或C++编写程序,要求:

输入命题公式,给出它的主合取范式和主析取范式.

例如运行时,从键盘输入:

p∧q∨r

程序能根据这个输入求出主析取范式:

p∧!q∧r)∨(!p∧q∧r)∨(p∧!q∧r)∧p∧q∧!r)∨(p∧q∧r)

同样得到主合取范式,∨可用or或&代替,∧可以用and或&&代替

输入:(p->q)->q

得到主析取范式:(p∧!q)∨(!p∧q)∨(p∧q)

p∨q∨r(主合取范式)

以下是原题:

1、设计并开发一个能帮助学习数理逻辑的小软件.

2、结合离散数学的相关知识,掌握VC等集成开发环境,开发一个能辅助教学的小软件.

1、输入命题公式,该软件能判断公式的类型,并列出真值表.

2、输入命题公式,给出它的主合取范式和主析取范式.

1、使用VC等集成开发环境设计并开发出一个辅助教学的小软件.

2、能够对命题公式的类型做出判断,能列出真值表,写出主范式.

3、有能力者可扩充数理逻辑的其他内容,譬如推理系统的构造和证明,求谓词公式的前束范式等.

何清回答:
  A-Z+isOR*isAND_is→#is♁(圆圈里加个+)@is⊙   $is↑命题的"与非"运算("与非门")   %is↓命题的"或非"运算("或非门")   Inputthesourceformula:   A*!S+R   Here!   8countTerms   NORMALc:(A*!S*!R)+(!A*!S*R)+(A*!S*R)+(!A*S*R)+(A*S*R)   NORMALd(A+S+R)*(A+!S+R)*(!A+!S+R)   !A+S*!R   Inputthesourceformula:   (!A+B)_R   Here!   8countTerms   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!   Inputthesourceformula:   A#B   Here!   4countTerms   NORMALc:(A*!B)+(!A*B)   NORMALd(A+B)*(!A+!B)   Error!   Inputthesourceformula:   A@B   Here!   4countTerms   NORMALc:(!A*!B)+(A*B)   NORMALd(!A+B)*(A+!B)   Error!   #include   #include   #include   #include   usingnamespacestd;   classformulaBase   {   private:   intnumVar;//Thenumberofthevariablesintheformula   boolvariables[100];//Tostorethevalueofthevariables   stringsourceFormula;   stringnormalCFormula;   stringnormalDFormula;   stringdualFormula;   vectorvctofVar;   vectorvctofPoland;   stackstk;   boolisVar(charch)const;   voidaddMin(intminterm);   voidaddMax(intmaxterm);   boolcompute(intminterm);   voidgetInversePoland();   intcountTerms(intn);   voidassign(intminterm);   stackboolStk;   public:   formulaBase();   formulaBase(constformulaBase&rhs);   formulaBase();   voidgetSource();   stringgenerateNormalC();   stringgenerateNormalD();   stringgetDual();   voidprintSource()const{cout
点击显示
其它推荐
热门其它推荐
  • 其它