• 2.2.2.5-chizma.
  • Buxoro davlat universiteti




    Download 1,04 Mb.
    bet24/27
    Sana14.06.2021
    Hajmi1,04 Mb.
    #15036
    1   ...   19   20   21   22   23   24   25   26   27
    2.2.2.4-chizma. Prologda xatolikni tekshirish

    Endi biz uchta yaratgan sinfimizni bir biriga bog’laymiz. Bu uchun biz Main sinfini yasab olamiz. Main sinfiga quyidagi dasturni kiritamiz.

    Project Name: tratactus

    UI Strategy: console

    implement main

    open core, console, semantic

    class predicates

    test:().

    clauses

    classInfo("main", "tratactus").

    test() :-

    german::phr(T, ["die", "Welt", "ist", "alles"], _X),

    write(T), nl, english::phr(T, Translation), !,

    write(Translation), nl.

    test().

    run():- console::init(), test().

    end implement main

    goal mainExe::run(main::run).



    Dasturimizni ishlatib ko’ramiz xatoligi bo’lmasa, bizga quyidagicha oyna hosil bo’ladi.



    2.2.2.5-chizma.Ishlatilgan dastur natijasi.

    Prologda semantic dasturini ishga tushgandan so’ng natijasi

    Bu dasturlardan chiqaruv daraxti yasaymiz.

    World< World,” ”>,case,”Welt”>>, World.”ist”>,case, “alles”>>>

    Yuqoridagilar Semantic proyektini natijasi.

    [“the”, “World”, “is”, “all”]

    [“die”, “Welt”, “ist”, “alles”]


    Download 1,04 Mb.
    1   ...   19   20   21   22   23   24   25   26   27




    Download 1,04 Mb.