精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 用C或C++編寫程序,要求:輸入命題公式,給出它的主合取范式和主析取范式.

    用C或C++編寫程序,要求:輸入命題公式,給出它的主合取范式和主析取范式.
    用C或C++編寫程序,要求:
    輸入命題公式,給出它的主合取范式和主析取范式.
    例如運(yùn)行時(shí),從鍵盤輸入:
    p∧q∨r
    程序能根據(jù)這個(gè)輸入求出主析取范式:
    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、設(shè)計(jì)并開發(fā)一個(gè)能幫助學(xué)習(xí)數(shù)理邏輯的小軟件.
    2、結(jié)合離散數(shù)學(xué)的相關(guān)知識(shí),掌握VC等集成開發(fā)環(huán)境,開發(fā)一個(gè)能輔助教學(xué)的小軟件.
    1、輸入命題公式,該軟件能判斷公式的類型,并列出真值表.
    2、輸入命題公式,給出它的主合取范式和主析取范式.
    1、使用VC等集成開發(fā)環(huán)境設(shè)計(jì)并開發(fā)出一個(gè)輔助教學(xué)的小軟件.
    2、能夠?qū)γ}公式的類型做出判斷,能列出真值表,寫出主范式.
    3、有能力者可擴(kuò)充數(shù)理邏輯的其他內(nèi)容,譬如推理系統(tǒng)的構(gòu)造和證明,求謂詞公式的前束范式等.
    其他人氣:740 ℃時(shí)間:2020-04-06 19:11:32
    優(yōu)質(zhì)解答
    A-Z + is OR * is AND _ is → # is?(圓圈里加個(gè)+) @ is ⊙
    $ is ↑ 命題的"與非" 運(yùn)算( "與非門" )
    % is ↓ 命題的"或非"運(yùn)算( "或非門" )
    Input the source formula:
    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
    Input the source formula:
    (!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!
    Input the source formula:
    A#B
    Here!
    4countTerms
    NORMALc:(A*!B)+(!A*B)
    NORMALd (A+B)*(!A+!B)
    Error!
    Input the source formula:
    A@B
    Here!
    4countTerms
    NORMALc:(!A*!B)+(A*B)
    NORMALd (!A+B)*(A+!B)
    Error!
    #include
    #include
    #include
    #include
    using namespace std;
    class formulaBase
    {
    private:
    int numVar;//The number of the variables in the formula
    bool variables[100];//To store the value of the variables
    string sourceFormula;
    string normalCFormula;
    string normalDFormula;
    string dualFormula;
    vector vctofVar;
    vector vctofPoland;
    stack 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 boolStk;
    public:
    formulaBase();
    formulaBase(const formulaBase& rhs);
    formulaBase();
    void getSource();
    string generateNormalC();
    string generateNormalD();
    string getDual();
    void printSource()const{cout
    我來回答
    類似推薦
    請(qǐng)使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁(yè)提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版