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”]
|