how the system give the result after receive the answer of questions of ask_sym ?

Discussions related to Visual Prolog
fathia
Posts: 9
Joined: 24 Jan 2011 10:23

how the system give the result after receive the answer of questions of ask_sym ?

Unread post by fathia » 5 Apr 2012 9:13

when running the following code :

Code: Select all

positive(X,Y):- xpositive(X,Y),!. positive(X,Y):- not(xnegative(X,Y)),ask(X,"y").   negative(X,Y):- xnegative(X,Y),!. negative(X,Y):- not(xpositive(X,Y)),ask(X,"n").   ask(X,"y"):-   Newdialog=ask_sym::new(applicationwindow::get Newdialog:show(), Newdialog:formask(X),stdio::write(X).     ask(X,"n"):- Newdialog=ask_sym::new(applicationwindow::get()), Newdialog:show(), Newdialog:formask(X).
it will give the result without receive the answer of ask_sym?can you help me ,how the system give the result after receive the answer of questions of ask_sym ?

Steve Lympany
VIP Member
Posts: 119
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 6 Apr 2012 16:37

Hi,
Please provide clauses for xpositive() and xnegative() plus all relevant declarations.
cheers
s

fathia
Posts: 9
Joined: 24 Jan 2011 10:23

Unread post by fathia » 29 Apr 2012 7:51

Code: Select all

class facts -personDB      xpositive:(string X).      xnegative:(string X). clauses   positive(X,Y):-   xpositive(X,Y),!. positive(X,Y):-   not(xnegative(X,Y)),ask(X,"y").    negative(X,Y):-   xnegative(X,Y),!.  negative(X,Y):-   not(xpositive(X,Y)),ask(X,"n").   ask(X,"y"):-   Newdialog=ask_sym::new(applicationwindow::get Newdialog:show(), Newdialog:formask(X),stdio::write(X).     ask(X,"n"):-   Newdialog=ask_sym::new(applicationwindow::get()), Newdialog:show(),   Newdialog:formask(X).   disease():-                                                                                                                                                         if positive("Blurred vision"),positive("Dry skin"),positive("Fatigue"),positive("Increased thirst"),! then                                                                                                    X="diabetes", writesymptom()                                                                                              else                                                                                                  X="no diabetes"             end if,             stdio::write(X),!.


it will give the result(print diabetes ) without receive the answer of ask_sym?can you help me ,how the system give the result after receive the answer of questions of ask_sym ?

Post Reply