visual prolog

Upload: snakefromhell3197

Post on 10-Jul-2015

1.050 views

Category:

Documents


6 download

TRANSCRIPT

Visual Prolog

1-:............................................................................................................................31-1 PROLOG VISUAL 3...........................................................................................................................PROLOG 2-1 VISUAL PROLOG INTERPRETER 3....................................COMPILER

2- VISUAL PROLOG ..............................................3 1-2 3..........................................................................................VISUAL PROLOG 2-2 ..................................................................................................3 3-2 ................................................................................................5 1-3-2 ................................................................. 5 2-3-2 ........................................................ 6 3-3-2 ........................................................ 6 4-3-2 ........................................................... 6 4-2 .............................................................................................................6 1-2-4 6 ............................................................................facts 2-2-4 6 ......................................................................constants 3-2-4 6 ..........................................global 3- 6...............................................................................VISUAL PROLOG 1-3 6............................................................................... VISUAL PROLOG 2-3 7...............................................................................................................LISTS 1-2-3 ....................................................................................... 7 2-2-3 ................................................... 8 2-2-3 - 1 .................................... 8 2-2-3 - 2 ................................................. 8 2-2-3 - 3 ............ 8 4-2-2-3 ....................................................................................... 9 2-2-3 - 5 .......................................................................................... 9 2-2-3 - 6 ................................................................................................ 9 4- 10..................................................VISUAL PROLOG 1-4 ........................................................................................................01 2-4 .......................................................................................................01 3-4 ........................................................................................11 4-4 .......................................................................................................11 1-4-4 ..................................................................................................... 21 2-4-4 ........ 21 5- 12..................................................................VISUAL PROLOG 1-5 12................................................................................CLASS DECLARATIONS 2-5 ...............................................................................................................31 3-5 ......................................................................................................31 4-5 ........................................................................................................31 5-5 .........................................................................................................31 6- 13......................................VISUAL PROLOG 7- .......................................................................................................................51

. -1002

Visual Prolog

8- APPLICATION EXPERT ..................61 1-8 .........................................................61 2-8 ..................................................12 1-2-8 ......................................................... 22 2-2-8 .................................................... 42 3-2-8 .................................................................... 42 4-2-8 ................................................................................................... 52 5-2-8 .......................................................... 52 6-2-8 . test | new window 82 7-2-8 draw | ellipse 30 ....................................................................................close 8-2-8 .............................................................. 53 9-2-8 .......................................................................... 04 01-2-8 ............................................................ 14 9- ........................................................................................................................14

. -1002

Visual Prolog

Visual Prolog 2.5 Version 1-: 1-1 Prolog Visual Prolog visual prolog Prolog . Visual Prolog ) ++c c .(Pascal 2-1 Visual Prolog INTERPRETER COMPILER Visual Prolog Visual Prolog ) ++C C .(Pascal 2- Visual Prolog 1-2 Visual Prolog Visual Prolog : 1- the domains section 2- the predicates section 3- The clauses section 4- The goal section Prolog. 2-2 Prolog : .)append([],Y,Y .)1append([X|X1],Y,[X|Z1]):-append(X1,Y,Z Visual Prolog : DOMAINS *numberList = number number = integer PREDICATES )append(numberList, numberList,numberList CLAUSES .)append([],Y,Y .)1append([X|X1],Y,[X|Z1]):-append(X1,Y,Z GOAL .)append([1,2], [ 3,4, 5,6],Z

. -1002

Visual Prolog

: 1. .Visual Prolog

2. file | new :

3. :member.pro

. -1002

Visual Prolog

4. : .)append([1,2], [ 3,4, 5,6],Z Project | Test Goal :

6,5,4,3,2,1[=. [Z . 3-2 : 1-3-2 DOMAINS *numberList = number number = integer namelist .name name . -1002

Visual Prolog

.symbol 2-3-2 PREDICATES )append(numberList, numberList,numberList member numberList .nondeterm 3-3-2 CLAUSES .)append([],Y,Y .)1append([X|X1],Y,[X|Z1]):-append(X1,Y,Z 4-3-2 GOAL .)append([1,2], [ 3,4, 5,6],Z 4-2 Visual Prolog : 1-2-4 facts Visual Prolog . .facts ,assert, asserta assertz, consult retract , retractall 2-2-4 constants : CONSTANTS 0 = false 1 = true 41.3 = pi 3-2-4 global visual prolog : global domains, global predicates, global .facts 3- Visual Prolog 1-3 Visual Prolog :

. -1002

Visual Prolog

,char, real, string, symbol, short, ushort, long,ulong, integer, unsigned, byte, sbyte .word, dword . d '.'d Char double .c Real null String c Symbol 86723- 76723 Short 0 53556 Ushort 8463847412 - 7463847412 Long 0 5927694924 Ulong Integer Unsigned 0-552 Byte -821 821 Sbyte 0 53556 Word 0 5927694924 Dword help\contents 2-3 Lists 1-2-3 Visual Prolog : DOMAINS *charList = char charList .char * char char . ) ( . : *valueList = value )value = b(byte); c(char); s(string);r(real : /* */

*valueList = value value=byte;char;string;real

: :Visual Prolog ]33,001, "[ ["foo", "zoo"], "doo

. -1002

Visual Prolog

. 2-2-3 2-2-3 -1 DOMAINS list = element* element=integer PREDICATES listLength(list,integer) CLAUSES listLength ([], 0). listLength ([_|R],L):- listLength (R,LR),L = LR + 1. GOAL listLength ([9,9,12,3,4,8], L). : L=6 Solution 1 2-2-3 -2 DOMAINS numberList = number* number = integer PREDICATES reverse(numberList, numberList,numberList) reverse(numberList,numberList) CLAUSES reverse(X,Y):-reverse(X,[],Y). reverse([X|X1],Acc,Y):-reverse(X1,[X|Acc],Y). reverse([],Y,Y). GOAL reverse([1,2,3,4,5],Z). 2-2-3 -3 DOMAINS namelist = name* name = symbol PREDICATES nondeterm del(name, namelist,namelist) CLAUSES del(_,[],[]).

2001-.

Visual Prolog

.)del(X,[X|Y],R):-del(X,Y,R .)del(X,[Y|Z],[Y|R]):-XY,del(X,Z,R GOAL .)del(green, [red,green, green,bleu] ,Z 4-2-2-3 DOMAINS *namelist = name name = symbol PREDICATES )nondeterm suffix(namelist, namelist CLAUSES .)suffix(X,X .)suffix(X,[_|Z]):-suffix(X,Z GOAL .)]suffix([ali,samir], [ ali,zaid, samir,ahmad 2-2-3 -5 DOMAINS *namelist = name name = symbol PREDICATES )prefix(namelist, namelist CLAUSES .)_,][(prefix .)prefix([X|A],[X|B]):-prefix(A,B GOAL .)]prefix([ali,samir], [ali, samir , ahmad,maher 2-2-3 -6 1- suffix prefix . 2- .quicksort 3- .BubbleSort 4- 5- : 0 0 1 0((s. -1002

Visual Prolog

2 0(((s(s 3 0((((s(s(s )0( s n n (n ( s s successor . : domains ;EXP = zero )s(EXP predicates ;)sum(EXP X,EXP Y,EXP Z clauses .)sum(X,zero,X .)sum(X,s(Y),s(Z)):-sum(X,Y,Z goal .)sum(s(s(s(zero))),s(zero),Z . 4- Visual Prolog Visual Prolog ...++c, c . 1-4 : )2X +Y+ 1 / (Z1+Z 2-4 Visual Prolog ) ( : * ,- ,+ * ,- ,+ * ,- ,+ * ,- ,+

. -1002

Visual Prolog

/ Div Mod

: 1 2 3 +* / mod div - + (unary 3-4 X Y X Y ) X ( X mod Y X div Y (Abs(X (cos(X (sin(X (tan(X (arctan(X e . X: 0 >= 1 < X Y: 0 >= Y < X (exp(X (ln(X (log(X (sqrt(X (Random(X (Random(X, Y (Round(X (trunc(X (Val(domain,X

4-4

. -1002

Visual Prolog

1-4-4 Visual Prolog : 21-X >= = 101 001 ASCII d 101 ASCII . e ""ali" > "alia symbols 5- Visual Prolog Visual Prolog . Visual Prolog . . . 1-5 Class declarations :

] CLASS class-name [: parentclass-list PREDICATES predicatedeclaration-list

. -1002

Visual Prolog

FACTS factdeclaration-list ENDCLASS parentclass-list .class-name 2-5 :

] IMPLEMENT class-name [: parentclass-list PREDICATES predicatedeclaration-list FACTS factdeclaration-list CLAUSES Clause-list ENDCLASS

3-5 new . 4-5 Visual Prolog ) (Java delete M sumElement : ,M = matrix::new ,)M:sumElement(Result .M:delete . 5-5 Visual Prolog static fact static . . Visual Prolog . ) . (constructors and destructors new .delete .baseclass::new 6- Visual Prolog

. -1002

Visual Prolog

DOMAINS file = myfile

:

. write Visual Prolog : openwrite(f1,"file1"), writedevice(f1) : closefile(f1) (writedevice(screen : 1: DOMAINS file = myfile integerList=integer* PREDICATES writeListToFile(integerList) CLAUSES writeListToFile([]). writeListToFile([H|T]):-write(H),nl,writeListToFile(T). GOAL openwrite(myfile,"hi.txt"), writedevice(myfile), writeListToFile([22,40,80,90,200,200]), closefile(myfile), writedevice(screen), write("the list [22,40,80,90,200,200] was saved to the file hi.txt"),nl. 2: ) ( : DOMAINS list = integer* PREDICATES read_list(list) length_of(list,integer) CLAUSES read_list([H|T]):write("> "), readint(H),!, read_list(T). read_list([]). length_of([], 0). length_of([_|T],L):length_of(T,TailLength), L = TailLength + 1. GOAL write(" Enter the a of integer ended by a char:"),nl, read_list(TheList),nl, length_of(TheList,TheLength). :

2001-.

Visual Prolog

line string integer real char : 1=FileMode 0=FileMode

,2Write(Param1, Param (Param3, ..., ParamN Nl ,2Writef(FormatString, Arg1, Arg (Arg3, ...,ArgN (Readln(Line (Readint(X (Readreal(X (Readchar(CharParam (Readterm(DomainName, Term ,Openread(SymbolicFileName (OSFileName ,Openwrite(SymbolicFileName (OSFileName ,Openappend(SymbolicFileName (OSFileName ,Openmodify(SymbolicFileName (OSFileName ,Filemode(SymbolicFileName (FileMode

(Closefile(SymbolicFileName Readdevice(SymbolicFileName (Writedevice(SymbolicFileName (Eof(SymbolicFileName

: . 7- :

: ("system("command system : .)"system("ren oldname.txt newname.txt : (time(Hours, Minutes, Seconds,Hundredths (date(Year, Month, Day, WeekDay ):(centiseconds )sleep(CSecs

. -1002

Visual Prolog

(marktime(CSecs,Ticket )timeout(Ticket )sound(Duration,Frequency

:

:

8- Application Expert 1-8 : Visual Prolog : project | new project

hello ' 'c:\hello .Base Directory VPI Options :

. -1002

Visual Prolog

. Create :

hello.pro VPITools.pro hello.pro . Project | Run :

. -1002

Visual Prolog

. . : menu :

Task Menu :

. -1002

Visual Prolog

& Edit New test ":"id_test

ok submenu new test say hello "."id_test_say_hello

. test Hello word say hello :. -1002

Visual Prolog

Window : code expert

:

say hello Menu " "Event Type id_test_say_hello " "Event or Item Add Clause Edit Clause say hello : %BEGIN Task Window, id_test_say_hello ,!-:)0,)task_win_eh(_Win,e_Menu(id_test_say_hello,_ShiftCtlAlt

. -1002

Visual Prolog

.! %END Task Window, id_test_say_hello Hello word : ! | Insert : Predicate Call | Window, Dialog or Toolbar :

.Ok : %BEGIN Task Window, id_test_say_hello ,!-:)0,)task_win_eh(_Win,e_Menu(id_test_say_hello,_ShiftCtlAlt ,"Title="Title ,)"dlg_Note(Title,"Hello word .! %END Task Window, id_test_say_hello ("dlg_Note(Title,"Hello word . test | say hello :

2-8 Visual Prolog : test Ellipse ),)1x1,y 2 ((x2,y :

. -1002

Visual Prolog

Project | New Project .dialogExample 1-2-8 menu new .

newMenuBar

new

. -1002

Visual Prolog

draw :ok

draw submenu

new :ellipse

. -1002

Visual Prolog

close . newMenuBar task menu :

2-2-8 newModule module new . 3-2-8 newWindow window new :

. -1002

Visual Prolog

newMenuBar .ok window code expert " "newModule .Default Code 4-2-8 Task Menu test new window 5-2-8 dialog new :

. -1002

Visual Prolog

mydialog ok :

controls :

. -1002

Visual Prolog

text Edit 2.idc_x1, idc_y1, idc_x2, idc_y ok .cancel ) 2(x1,y1), (x2,y code expert :

. Dialog Pack :

. -1002

Visual Prolog

1 idc_x edit 1 idc_x integer :

2.idc_y1, idc_x2, idc_y . ok default code ..newModule.pro 6-2-8 test | new window test | new window newWindow : window code expert task window :

. -1002

Visual Prolog

menu id_test_new_window :add clause

edit clause newModule.pre id_test_new_window : %BEGIN Task Window, id_test_new_window ,!-:)0,)task_win_eh(_Win,e_Menu(id_test_new_window,_ShiftCtlAlt .! %END Task Window, id_test_new_window : Insert | Predicate Call | Window, Dialog or Toolbar :

. -1002

Visual Prolog

. %BEGIN Task Window, id_test_new_window ,!-:)0,)task_win_eh(_Win,e_Menu(id_test_new_window,_ShiftCtlAlt ,)win_newwindow_Create(_Win .! %END Task Window, id_test_new_window 7-2-8 draw | ellipse close draw | ellipse myDialog : window code expert newWindow :

menu id_draw_ellipse :add clause

. -1002

Visual Prolog

newModule.pre edit clause id_test_new_window : %BEGIN newWindow, idr_draw_ellipse win_newwindow_eh(_Win,e_Menu(idr_draw_ellipse,_ShiftCtlAlt),0):-!, !. %END newWindow, idr_draw_ellipse Insert | Predicate Call | Window, Dialog or Toolbar :

. %BEGIN newWindow, idr_draw_ellipse win_newwindow_eh(_Win,e_Menu(idr_draw_ellipse,_ShiftCtlAlt),0):-!, dlg_mydialog_Create(_Win), !. %END newWindow, idr_draw_ellipse

2001-.

Visual Prolog

:draw | close : %BEGIN newWindow, idr_draw_close win_newwindow_eh(_Win,e_Menu(idr_draw_close,_ShiftCtlAlt),0):-!, win_Destroy(_Win), retractall(p(_,_,_,_)), !. %END newWindow, idr_draw_close .( win_Destroy(_Win )_,_,_,_( p )_,_,_,_(( retractall(p . : newModule include "dialogexample.inc" include "dialogexample.con" include "hlptopic.con" %BEGIN_WIN newWindow /************************************************************************** Creation and event handling for window: newWindow **************************************************************************/ constants %BEGIN newWindow, CreateParms, 11:25:51-23.5.2001, Code automatically updated! win_newwindow_WinType = w_TopLevel win_newwindow_Flags= [wsf_SizeBorder,wsf_TitleBar,wsf_Maximize,wsf_Minimize,wsf_Close,wsf_ClipSiblings,wsf_ClipCh ildren] win_newwindow_RCT = rct(100,80,440,240) win_newwindow_Menu = res_menu(id_newmenubar) win_newwindow_Title = "newWindow" win_newwindow_Help = idh_contents %END newWindow, CreateParms predicates win_newwindow_eh : EHANDLER clauses win_newwindow_Create(_Parent):win_Create(win_newwindow_WinType,win_newwindow_RCT,win_newwindow_Title, win_newwindow_Menu,_Parent,win_newwindow_Flags,win_newwindow_eh,0). %BEGIN newWindow, e_Create win_newwindow_eh(_Win,e_Create(_),0):-!, %BEGIN newWindow, InitControls, 11:25:51-23.5.2001, Code automatically updated! %END newWindow, InitControls %BEGIN newWindow, ToolbarCreate, 11:25:51-23.5.2001, Code automatically updated! %END newWindow, ToolbarCreate !. %END newWindow, e_Create %MARK newWindow, new events %BEGIN newWindow, idr_draw_close win_newwindow_eh(_Win,e_Menu(idr_draw_close,_ShiftCtlAlt),0):-!, win_Destroy(_Win), retractall(p(_,_,_,_)),

2001-.

Visual Prolog !. %END newWindow, idr_draw_close %BEGIN newWindow, e_CloseRequest win_newwindow_eh(_Win,e_CloseRequest,0):-!, !. %END newWindow, e_CloseRequest %BEGIN newWindow, idr_draw_ellipse win_newwindow_eh(_Win,e_Menu(idr_draw_ellipse,_ShiftCtlAlt),0):-!, dlg_mydialog_Create(_Win), !. %END newWindow, idr_draw_ellipse %BEGIN newWindow, e_Size win_newwindow_eh(_Win,e_Size(_Width,_Height),0):-!, ifdef use_tbar toolbar_Resize(_Win), enddef !. %END newWindow, e_Size %BEGIN newWindow, e_Menu, Parent window win_newwindow_eh(Win,e_Menu(ID,CAS),0):-!, PARENT = win_GetParent(Win), win_SendEvent(PARENT,e_Menu(ID,CAS)), !. %END newWindow, e_Menu, Parent window %END_WIN newWindow %BEGIN_DLG myDialog /************************************************************************** Creation and event handling for dialog: myDialog **************************************************************************/ constants %BEGIN myDialog, CreateParms, 12:10:24-23.5.2001, Code automatically updated! dlg_mydialog_ResID = idd_mydialog dlg_mydialog_DlgType = wd_Modal dlg_mydialog_Help = idh_contents %END myDialog, CreateParms predicates dlg_mydialog_eh : EHANDLER dlg_mydialog_handle_answer(INTEGER EndButton,DIALOG_VAL_LIST) dlg_mydialog_update(DIALOG_VAL_LIST) clauses dlg_mydialog_Create(Parent):%MARK myDialog, new variables dialog_CreateModal(Parent,dlg_mydialog_ResID,"", [ %BEGIN myDialog, ControlList, 12:10:24-23.5.2001, Code automatically updated! df(idc_x1,editint(void,[]),nopr), df(idc_y1,editint(void,[]),nopr),

2001-.

Visual Prolog df(idc_x2,editint(void,[]),nopr), df(idc_y2,editint(void,[]),nopr) %END myDialog, ControlList ], dlg_mydialog_eh,0,VALLIST,ANSWER), dlg_mydialog_handle_answer(ANSWER,VALLIST). dlg_mydialog_handle_answer(idc_ok,VALLIST):-!, dlg_mydialog_update(VALLIST). dlg_mydialog_handle_answer(idc_cancel,_):-!. % Handle Esc and Cancel here dlg_mydialog_handle_answer(_,_):errorexit(). dlg_mydialog_update(_VALLIST):%BEGIN myDialog, Update controls, 12:10:24-23.5.2001, Code automatically updated! _IDC_X1_VALUE = dialog_VLGetint(idc_x1,_VALLIST), _IDC_Y1_VALUE = dialog_VLGetint(idc_y1,_VALLIST), _IDC_X2_VALUE = dialog_VLGetint(idc_x2,_VALLIST), _IDC_Y2_VALUE = dialog_VLGetint(idc_y2,_VALLIST), %END myDialog, Update controls true. %MARK myDialog, new events dlg_mydialog_eh(_,_,_):-!,fail. %END_DLG myDialog

2001-.

Visual Prolog

8-2-8 : include "dialogexample.inc" include "dialogexample.con" include "hlptopic.con" facts -ellipsParameter p(integer,integer,integer,integer)

" p"

domains listInteger=integer* predicates /* to draw all the ellipse */ draw(WINDOW,listInteger,listInteger,listInteger,listInteger)

clauses draw(_,[],[],[],[]). draw(W,[X1|T1],[Y1|T2],[X2|T3],[Y2|T4]):draw_ellipse(W,rct(X1,Y1,X2,Y2)),draw(W,T1,T2,T3,T4).

" draw" . %BEGIN_WIN newWindow /************************************************************************** Creation and event handling for window: newWindow **************************************************************************/ constants %BEGIN newWindow, CreateParms, 11:25:51-23.5.2001, Code automatically updated! win_newwindow_WinType = w_TopLevel win_newwindow_Flags= [wsf_SizeBorder,wsf_TitleBar,wsf_Maximize,wsf_Minimize,wsf_Close,wsf_ClipSiblings,wsf_ClipCh ildren] win_newwindow_RCT = rct(100,80,440,240) win_newwindow_Menu = res_menu(id_newmenubar) win_newwindow_Title = "newWindow" win_newwindow_Help = idh_contents %END newWindow, CreateParms predicates win_newwindow_eh : EHANDLER

2001-.

Visual Prolog

clauses

2001-.

Visual Prolog win_newwindow_Create(_Parent):win_Create(win_newwindow_WinType,win_newwindow_RCT,win_newwindow_Title, win_newwindow_Menu,_Parent,win_newwindow_Flags,win_newwindow_eh,0). %BEGIN newWindow, e_Create win_newwindow_eh(_Win,e_Create(_),0):-!, %BEGIN newWindow, InitControls, 11:25:51-23.5.2001, Code automatically updated! %END newWindow, InitControls %BEGIN newWindow, ToolbarCreate, 11:25:51-23.5.2001, Code automatically updated! %END newWindow, ToolbarCreate !. %END newWindow, e_Create %MARK newWindow, new events %BEGIN newWindow, e_Update win_newwindow_eh(_Win,e_Update(_UpdateRct),0):-!, findall(X1,p(X1,_,_,_),L1), findall(Y1,p(_,Y1,_,_),L2), findall(X2,p(_,_,X2,_),L3), findall(Y2,p(_,_,_,Y2),L4), draw(_Win,L1,L2,L3,L4),

e_Update ) .( !. %END newWindow, e_Update %BEGIN newWindow, idr_draw_close win_newwindow_eh(_Win,e_Menu(idr_draw_close,_ShiftCtlAlt),0):-!, win_Destroy(_Win), retractall(p(_,_,_,_)), !. %END newWindow, idr_draw_close %BEGIN newWindow, e_CloseRequest win_newwindow_eh(_Win,e_CloseRequest,0):-!, !. %END newWindow, e_CloseRequest

2001-.

Visual Prolog %BEGIN newWindow, idr_draw_ellipse win_newwindow_eh(_Win,e_Menu(idr_draw_ellipse,_ShiftCtlAlt),0):-!, dlg_mydialog_Create(_Win),

draw | ellipse dlg_mydialog_Create mydialog windows ( win_Invalidate(_Win e_Updatewin_Invalidate(_Win), !. %END newWindow, idr_draw_ellipse %BEGIN newWindow, e_Size win_newwindow_eh(_Win,e_Size(_Width,_Height),0):-!,

windows e_Size ) ( win_Invalidate(_Win), IFDEF use_tbar toolbar_Resize(_Win), ENDDEF !. %END newWindow, e_Size %BEGIN newWindow, e_Menu, Parent window win_newwindow_eh(Win,e_Menu(ID,CAS),0):-!, PARENT = win_GetParent(Win), win_SendEvent(PARENT,e_Menu(ID,CAS)), !. %END newWindow, e_Menu, Parent window %END_WIN newWindow %BEGIN_DLG myDialog /************************************************************************** Creation and event handling for dialog: myDialog **************************************************************************/ constants %BEGIN myDialog, CreateParms, 12:10:24-23.5.2001, Code automatically updated! dlg_mydialog_ResID = idd_mydialog dlg_mydialog_DlgType = wd_Modal dlg_mydialog_Help = idh_contents %END myDialog, CreateParms

2001-.

Visual Prolog

predicates

2001-.

Visual Prolog dlg_mydialog_eh : EHANDLER dlg_mydialog_handle_answer(INTEGER EndButton,DIALOG_VAL_LIST) dlg_mydialog_update(DIALOG_VAL_LIST) clauses dlg_mydialog_Create(Parent):%MARK myDialog, new variables dialog_CreateModal(Parent,dlg_mydialog_ResID,"", [ %BEGIN myDialog, ControlList, 12:10:24-23.5.2001, Code automatically updated! df(idc_x1,editint(void,[]),nopr), df(idc_y1,editint(void,[]),nopr), df(idc_x2,editint(void,[]),nopr), df(idc_y2,editint(void,[]),nopr) %END myDialog, ControlList ], dlg_mydialog_eh,0,VALLIST,ANSWER), dlg_mydialog_handle_answer(ANSWER,VALLIST). dlg_mydialog_handle_answer(idc_ok,VALLIST):-!, dlg_mydialog_update(VALLIST). dlg_mydialog_handle_answer(idc_cancel,_):-!. % Handle Esc and Cancel here dlg_mydialog_handle_answer(_,_):errorexit(). dlg_mydialog_update(_VALLIST):%BEGIN myDialog, Update controls, 12:10:24-23.5.2001, Code automatically updated! _IDC_X1_VALUE = dialog_VLGetint(idc_x1,_VALLIST), _IDC_Y1_VALUE = dialog_VLGetint(idc_y1,_VALLIST), _IDC_X2_VALUE = dialog_VLGetint(idc_x2,_VALLIST), _IDC_Y2_VALUE = dialog_VLGetint(idc_y2,_VALLIST), %END myDialog, Update controls _IDC_X1_VALUE =i(X1), _IDC_Y1_VALUE =i(Y1), _IDC_X2_VALUE =i(X2), _IDC_Y2_VALUE =i(Y2),

mydialog . assert( p(X1,Y1,X2,Y2)), true. %MARK myDialog, new events dlg_mydialog_eh(_,_,_):-!,fail. %END_DLG myDialog

9-2-8

2001-.

Visual Prolog

test | new window draw ok . 01-2-8 .2((draw_ellipse(W,rct(X1,Y1,X2,Y Visual Prolog draw text: )" draw_Text(_Win, 100, 200, "This is a text draw_PolyGon : ,)001,541(draw_PolyGon(_Win,[pnt(130,130),pnt(180,130),pnt )])011,071(pnt(150,150),pnt draw_Rect : ))004,003,002,001(draw_Rect(_Win, rct ..... e_size e_update . findall : )1findall(X1,p(X1,_,_,_),L 1 (_,_,_,p(X 1 X 1.L Visual Prolog .Visual Prolog 9- 1- Visual Prolog Version 5.0- Getting Started 2- Visual Prolog Version 5.0, Language Tutorial 3- Leon Sterling, Ehud Shapiro- The Art Of Prolog

: 1- Prolog 0002

. -1002