PSP (Prolog Server Page) & XPCE

3c5cfe2093ca5fe80fee470f861c6d84
0
Imorsh 101 Aug 22, 2006 at 19:31

Hi peoples,

I am really really new in AI as well as programming. Its seems to be very helpful forum!

I am just wondering whether any one worked on PSP (Prolog server page), very interesting tool to give prolog a graphical interface.

(http://www.benjaminjohnston.com.au/template.prolog?t=psp)

I need help in terms of PSP configuration as well your valuable ideas to roll the ball. Perhaps some examples will help!!

On the other hand, I am trying to run an example from XPCE user manual in SWI prolog but I can not get expected result. May be I dont know how to compile and run XPCE sample in SWI prolog.

Below is the code for program I am trying to implement in XPCE

ask_employee :-
new(Dialog, dialog(‘Define employee’)),
send_list(Dialog, append,
[ new(N1, text_item(first_name)),
new(N2, text_item(family_name)),
new(S, new(S, menu(sex))),
new(A, int_item(age, low := 18, high := 65)),
new(D, menu(department, cycle)),
button(cancel, message(Dialog, destroy)),
button(enter, and(message(@prolog,
assert_employee,
N1?selection,
N2?selection,
S?selection,
A?selection,
D?selection),
message(Dialog, destroy)))
]),
send_list(S, append, [male, female]),
send_list(D, append, [research, development, marketing]),
send(Dialog, default_button, enter),
send(Dialog, open).

assert_employee(FirstName, FamilyName, Sex, Age, Depth) :-
format(‘Adding \~w \~w \~w, age \~w, working at \~w\~n’,
[ Sex, FirstName, FamilyName, Age, Depth]).
source: User manual of XPCE

could any one please help me by writing steps needs to run this program. Please.

Any help would be greatly appreciated.

Many thanks

1 Reply

Please log in or register to post a reply.

4413189eb92ecb0c72aa193596bda383
0
Trap_D 101 Aug 29, 2006 at 22:19

I don’t know PSP, but in SWI-Prolog you can test-it
You just have to create a new file (File/New..)employee.pl, type the code, compile it (Compile/Compile buffer) and type in the SWI-Prolog Window ask_employee.