Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Both sides previous revision Poprzednia wersja
Nowa wersja
Poprzednia wersja
pl:miw:miw08_ruleruntimeg_2 [2008/03/17 23:08]
miw
pl:miw:miw08_ruleruntimeg_2 [2008/07/01 20:17]
gjn
Linia 1: Linia 1:
-====== Opis ====== ​ 
-Damian Janicki <​janicki.damian@gmail.com>​ 
- 
-Investigate runtime integration aspects, mainly semi-automatical building of a GUI for Prolog programs possibilities XPCE, Static QT/Gtk, Gtk-Server, Java (Swing), Eclipse (SWT) 
- 
-    * input 
- 
-XPCE, QT, GTK, GtkServer, Java etc., SWI Prolog documentation 
- 
-    * output 
- 
-Feasibility study, a prototype. 
- 
-    * integration options for Java: JPL (SWI),​Logtalk (OO Prolog), architecture:​ MVC 
-    * approach: 2 -3 app. cases, M prolog, V in Java, C -> JPL/​Logtalk,​ e.g. ready M in Prolog, build V in Java: Car ES, opposite: ready MV i Java, build M in Prolog, make it work with the V 
- 
-====== Spotkania ====== ​ 
-===== 08.03.04 ===== 
-  * **MISSED** prototyp dla car, tj. ask_question 
- 
-===== 080311 ===== 
-  * problems, problems 
- 
-===== 080318 ===== 
-  * przerobienie car na wywołanie V w Javie 
- 
- 
- 
-====== Projekt ====== 
-Oryginalny system ([[pl:​prolog:​prolog_lab:​prolog_lab_2#​tematprosty_system_ekspertowy]]) 
- 
-== Predykat tworzący dialog, za pomocą, którego pobieramy informacje od użytkownika == 
-<code prolog> 
-show_yes_no_dialog(Tekst,​Response) :- 
- jpl_new(array(class([java,​lang],​['​String'​])),​['​yes','​no'​],​ ArrayRef), 
- jpl_get(ArrayRef,​0,​ArrayPosRef),​ 
- jpl_get('​javax.swing.JOptionPane',​ '​YES_NO_OPTION',​ YesNoRef), 
- jpl_get('​javax.swing.JOptionPane',​ '​QUESTION_MESSAGE',​ QuestionRef),​ 
- jpl_call('​javax.swing.JOptionPane',​ '​showOptionDialog',​ [@(null), 
-        ​Tekst, ​ 
-        '​Question',​ 
-        ​YesNoRef,​ 
-        ​QuestionRef,​ 
-        ​@(null), ​ 
-        ​ArrayRef, ​ 
-        ​ArrayPosRef], ​ 
-        ​RetVal),​ 
- interpret(RetVal,​Response). 
- 
-interpret(1,​no). ​ 
-interpret(0,​yes). ​ 
-</​code>​ 
- 
-== Predykat tworzący dialog, który wyświetla informacje o uszkodzeniach == 
-<code prolog> 
-show_explain_dialog(Tekst) :- 
- jpl_call('​javax.swing.JOptionPane',​ '​showMessageDialog',​ [@('​null'​),​Tekst],​_). 
-</​code>​ 
- 
- 
-== Predykat ask_question == 
-Przed zmianami: 
-<code prolog> 
-ask_question(starter_was_ok) :- 
-   ​write('​When you first started trying to start the car,'​),​nl,​ 
-   ​write('​did the starter crank the engine normally? '),nl. 
-</​code>​ 
- 
-Po zmianach (korzysta z Java): 
-<code prolog> 
-ask_question(starter_was_ok,​Res) :- 
- show_yes_no_dialog('​When you first started trying to start the car did the starter crank the engine normally?',​Res). 
-</​code>​ 
- 
-== Predykat explain ​ == 
-Przed zmianami: 
-<code prolog> 
-explain(wrong_gear) :- 
-   nl, 
-   ​write('​Check that the gearshift is set to Park or Neutral.'​),​nl,​ 
-   ​write('​Try jiggling the gearshift lever.'​),​nl. 
-</​code>​ 
- 
-Po zmianach: 
-<code prolog> 
-explain(wrong_gear) :- 
- show_explain_dialog('​Check that the gearshift is set to Park or Neutral.Try jiggling the gearshift lever.'​). 
-</​code>​ 
- 
-== Predykat user_says: == 
-Przed: 
-<code prolog> 
-user_says(Q,​A) :- \+ stored_answer(Q,​_),​ 
-                  ask_question(Q),​ 
-                  get_yes_or_no(Response),​ 
-                  asserta(stored_answer(Q,​Response)),​ 
-                  Response = A. 
-</​code>​ 
-Po: 
-<code prolog> 
-user_says(Q,​A) :- \+ stored_answer(Q,​_),​ 
-                  ask_question(Q,​Response),​ 
-   asserta(stored_answer(Q,​Response)),​ 
-                  Response = A. 
-</​code>​ 
- 
-V: Interfejs w Javie 
-== Funkcja wywolujaca prologa == 
-<code java> 
-private void startDiagnose(){ 
- Query queryConsult = new Query("​consult",​ new Atom("​pl/​carJPL.pl"​));​ 
- queryConsult.query();​ 
-  
- Query start = new Query("​start"​);​ 
- start.query();​ 
-} 
-</​code>​ 
- 
-[[pl:​miw:​miw08_ruleruntimeg_2:​pliki|Źródła projektu]] 
- 
-====== Sprawozdanie ====== 
- 
- 
-====== Materiały ====== 
- 
- 
-[[http://​www.swi-prolog.org/​packages/​jpl/​|JPL - Prolog/Java interface]] 
- 
- 
- 
- 
- 
  
pl/miw/miw08_ruleruntimeg_2.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0