Page 1 of 1

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

Posted: 5 Apr 2012 9:13
by fathia
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 ?

Posted: 6 Apr 2012 16:37
by Steve Lympany
Hi,
Please provide clauses for xpositive() and xnegative() plus all relevant declarations.
cheers
s

Posted: 29 Apr 2012 7:51
by fathia

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 ?