title: Prolog and java
body: <p>I am currently working on a project (Expert System). I've written code in PROLOG which identifies type of Diabetes by asking series of questions.My problem is I need to feed these question to the user through the arduino and I'm not able to add prolog plugins in Arduino IDE,Eclipse or netbeans. I managed to execute code in their respective IDE, for example to run temperature sensor I'm using arduino IDE, and to run Prolog I'm using SWI prolog,but I need to run all these different codes together in a common platform. Can anybody help me with this?</p>
  
  <p>code:</p>
  
  <pre><code>:- use_module(library(jpl)).
  
  start :-sleep(0.4),
      write('----------------------------------------------------------------- 
  '),nl,
      sleep(0.4),
  write('*****************************************************************'),n 
   l,
      sleep(0.2),
      write("###################||| EXPERT SYSTEM 
  |||#########################"),nl,
      sleep(0.4),
  
  
  
  
  
      write('----------------------------------------------------------------- 
      '),nl,nl,nl,
  
  
  
  
      interface2.
  
  
  
  symptom(Patient,female) :- verify(Patient," Are you a female(y/n) ?").
  
  
  symptom(Patient,increasedthirst) :- verify(Patient," have a Increased Thirst 
  (y/n) ?").
  
  symptom(Patient,urgetourinate) :- verify(Patient," have a increase urge to 
  urinate (y/n) ?").
  
  symptom(Patient,appetite) :- verify(Patient," have a Increaded Appetite 
  (y/n) ?").
  
  symptom(Patient,weightred) :- verify(Patient," have a weight reduction (y/n) 
   ?").
  
  symptom(Patient,overweight) :- verify(Patient," have signs of weight gain 
  (y/n) ?").
  
  symptom(Patient,vision) :- verify(Patient," have Impaired vision (y/n) ?").
  
  symptom(Patient,tiredness) :- verify(Patient," have a tiredness (y/n) ?").
  
  symptom(Patient,impatience) :- verify(Patient," Are you often impatient 
  (y/n) ?").
  
  symptom(Patient,infection) :- verify(Patient," Are suffering from any 
  infection (y/n) ?").
  
  symptom(Patient,bed) :- verify(Patient," bed wetting (y/n) ?").
  
  symptom(Patient,fruitbreath) :- verify(Patient," have a fruity breath (y/n) 
  ?").
  
  symptom(Patient,slowheal) :- verify(Patient," is your wound healing slowly 
  (y/n) ?").
  
  symptom(Patient,sleep) :- verify(Patient," have sleeplessness (y/n) ?").
  
  symptom(Patient,trembling) :- verify(Patient," do you tremble sometimes 
  (y/n) ?").
  
  symptom(Patient,sweating) :- verify(Patient," Do you Sweat (y/n) ?").
  
  symptom(Patient,weak) :- verify(Patient," have weakness (y/n) ?").
  
  symptom(Patient,anxiety) :- verify(Patient," have a axiety (y/n) ?").
  
  symptom(Patient,confuse) :- verify(Patient," have confusion while making 
  decisions (y/n) ?").
  
  symptom(Patient,mood) :- verify(Patient," have mood swings (y/n) ?").
  
  symptom(Patient,nausea) :- verify(Patient," have nausea (y/n) ?").
  
  symptom(Patient,vomit) :- verify(Patient," have vomiting (y/n) ?").
  
  symptom(Patient,dryskin) :- verify(Patient," have dry skin (y/n) ?").
  
  symptom(Patient,itchy) :- verify(Patient," have itchy skin (y/n) ?").
  
  symptom(Patient,sense) :- verify(Patient," have tingling sensation (y/n) 
  ?").
  
  symptom(Patient,gum) :- verify(Patient," have recurring gum infection(y/n) 
  ?").
  
  symptom(Patient,previouspreg) :- verify(Patient," Have you experience 
  pregnancy before(y/n) ?").
  
  symptom(Patient,baby) :- verify(Patient," Was your baby weighing over 9 
  pounds during previous pregnancy (y/n) ?").
  
  symptom(Patient,mycotic) :- verify(Patient," Any signs of vaginal mycotic 
  infection(y/n) ?").
  
  symptom(Patient,pressure) :- verify(Patient," have high blood pressure(y/n) 
   ?").
  
  
  
  
  
  
  
  
  
  
     hypothesis(Patient,type1) :-
  
     symptom(Patient,increasedthirst),
     symptom(Patient,urgetourinate),
     symptom(Patient,appetite),
     symptom(Patient,weightred),
     symptom(Patient,fruitbreath),
     symptom(Patient,bed),
     symptom(Patient,sleep),
     symptom(Patient,trembling),
     symptom(Patient,sweating),
     symptom(Patient,anxiety),
     symptom(Patient,confuse),
     symptom(Patient,weak),
     symptom(Patient,mood),
     symptom(Patient,nausea),
     symptom(Patient,vomit),
     symptom(Patient,tiredness).
  
    hypothesis(Patient,type2) :-
  
    symptom(Patient,increasedthirst),
    symptom(Patient,urgetourinate),
    symptom(Patient,appetite),
    symptom(Patient,overweight),
    symptom(Patient,vision),
    symptom(Patient,tiredness),
    symptom(Patient,impatience),
    symptom(Patient,infection),
    symptom(Patient,slowheal),
    symptom(Patient,sleep),
    symptom(Patient,trembling),
    symptom(Patient,sweating),
    symptom(Patient,anxiety),
    symptom(Patient,confuse),
    symptom(Patient,impatience),
    symptom(Patient,dryskin).
  
    hypothesis(Patient,prediabetic) :-
  
    symptom(Patient,increasedthirst),
    symptom(Patient,urgetourinate),
    symptom(Patient,appetite),
    symptom(Patient,overweight),
    symptom(Patient,vision),
    symptom(Patient,itchy),
    symptom(Patient,impatience),
    symptom(Patient,infection),
    symptom(Patient,stress),
    symptom(Patient,sense),
    symptom(Patient,gum).
  
     hypothesis(Patient,gestationaldiabetes):-
      symptom(Patient,female),
      symptom(Patient,overweight),
      symptom(Patient,previouspreg),
      symptom(Patient,baby),
      symptom(Patient,mycotic),
      symptom(Patient,pressure).
  
  
  
  
  
  
  
  hypothesis(_,"disease. But I'm Sorry, I don't seem to be able to diagnose 
  the disease").
  
  response(Reply) :-
      read(Reply),
      write(Reply),nl.
  
  ask(Patient,Question) :-
  write(Patient),write(', '),write(Question),
  /*read(N),
  ( (N == yes ; N == y)
    -&gt;
     assert(yes(Question)) ;
     assert(no(Question)), fail),*/
  
  interface(',',Patient,Question),
  write('Loading.'),nl,
  sleep(1),
  /*write('Loading..'),nl,
  sleep(1),
  write('Loading...'),nl,
  sleep(1),*/
  nl.
  
  :- dynamic yes/1,no/1.
  
  verify(P,S) :-
  (yes(S)
  -&gt;
  true ;
  (no(S)
   -&gt;
   fail ;
   ask(P,S))).
  
    undo :- retract(yes(_)),fail.
    undo :- retract(no(_)),fail.
    undo.
  
  
    pt(Patient):-
  
      hypothesis(Patient,Disease),
      interface3(Patient,', you probably have ',Disease,'.'),
              write(Patient),write(', you probably have 
        '),write(Disease),write('.'),undo,end.
  
  
      end :-
      nl,nl,nl,
      sleep(0.7),
  
      write('**********************************************************'),nl,
      sleep(0.4),
      write("################||| THANK YOU FOR USE ME 
      |||#####################"),nl,
      sleep(0.4),
  
  
  
  
      write('*********************************************************'),nl.
  </code></pre>