Both sides previous revision
Poprzednia wersja
Nowa wersja
|
Poprzednia wersja
|
pl:miw:miw08_ruleruntimeg [2008/04/22 11:18] miw |
pl:miw:miw08_ruleruntimeg [2008/07/05 11:08] gjn |
====== Opis ====== | |
Filip Haftek <filiphaftek@o2.pl> | |
| |
Investigate runtime integration aspects, mainly | |
semi-automatical building of a GUI for Prolog programs possibilities | |
XPCE, Static QT/Gtk, [[http://www.gtk-server.org|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 inv Java, C-> JPL/Logtalk, e.g. ready M in Prolog, build V in Java: [[pl:prolog:prolog_lab:prolog_lab_2#cwiczenieprosty_system_ekspertowy|Car ES]], opposite: ready MV i Java, build M in Prolog, make it work with the V | |
| |
__SWING__ __LogTalk__ | |
| |
| |
====== Spotkania ====== | |
| |
===== 080304 ===== | |
===== 080318 ===== | |
* car.pl skoncz | |
| |
===== 080401 ===== | |
* upload car.pl do wiki | |
* do przeanalizowani: [[pl:prolog:prolog_lab:prolog_lab_6#tematprzyklady_systemow_regulowych|inne systemy]] | |
| |
| |
| |
| |
| |
===== 080422 ===== | |
* xshell oops | |
| |
| |
| |
| |
| |
============ Projekt ====== | |
| |
============ 1. PROSTY SYSTEM EKSPERCKI ====== | |
==Predykat tworzący okno z pytaniem:== | |
<code prolog> | |
question(Result,T):- | |
jpl_call('javax.swing.JOptionPane','showConfirmDialog',[(@null),T,'Question',0],X), | |
change(X,Result). | |
</code> | |
==Predykat pokazujący informacje:== | |
<code prolog> | |
info(X):- | |
jpl_call('javax.swing.JOptionPane','showMessageDialog',[(@null),X],F). | |
</code> | |
| |
==Predykat get_yes_or_no:== | |
Przed: | |
<code prolog> | |
get_yes_or_no(Result) :- get(Char), | |
get0(_), | |
interpret(Char,Result), | |
!. | |
</code> | |
Po: | |
<code prolog> | |
get_yes_or_no(Q,Result) :- | |
ask_question(Q,X), | |
question(Result,X). | |
</code> | |
==Predykat ask_question:== | |
Przed: | |
<code prolog> | |
ask_question(fuel_is_ok) :- | |
write('Look in the carburetor. Can you see or smell gasoline?'),nl. | |
</code> | |
Po zmianach stał się termem: | |
<code prolog> | |
ask_question(fuel_is_ok,'Look in the carburetor. Can you see or smell gasoline?'). | |
</code> | |
==Predykat user_says:== | |
Przed: | |
<code prolog> | |
user_says(Q,A) :- \+ stored_answer(Q,_), | |
nl,nl, | |
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,_), | |
get_yes_or_no(Q,Response), | |
asserta(stored_answer(Q,Response)), | |
Response = A. | |
</code> | |
[[pl:miw:miw08_ruleruntimeg:car|Plik car.pl]] | |
| |
| |
| |
| |
| |
| |
| |
| |
============ 2. ZAAWANSOWANE SYSTEMY EKSPERCKIE ====== | |
GUI wykonane w Javie, logika w Prologu. | |
| |
**2.1 XSHELL** System do rozpoznowania ryb. | |
| |
[[pl:miw:miw08_ruleruntimeg:xshell|Plik xshell.pl]] | |
| |
**2.2 OOPS** System do produkcji zabawek. | |
| |
| |
**2.3 Wymagane pliki** | |
Spakowany miw2.jar - zawiera niezbędne klasy: {{:pl:miw:miw2.zip|miw2.zip}} | |
| |
====== Sprawozdanie ====== | |
| |
====== Materiały ====== | |