This is a manual for IP modeller "IPmodel.pl" on Sicstus Prolog 2.1 #6.

1.Start Sicstus Prolog:

% prolog
or
% sicstus

2.Load Program:

| ?- ['IPmodel.pl'].

3.Input logic form (see some examples attached following):

| ?- try(a or b).

you can get following ouputs:

          |===========================================|
          |                                           |
          |                IP Modeller                |
          |                Version 1.0                |
          |                                           |
          |                 Qiang Li                  |
          |          University of Tsukuba            |
          |                                           |
          |                 Yike Guo                  |
          |   Dept. of Computing, Imperial College    |
          |                                           |
          |          Co-operated under AITEC          |
          |            research project 1997          |
          |                                           |
          |===========================================|


Logic formulation :

 a or b

IP formulation:

 a+b>=1

4. For displaying detailed information about transformation from logic form
to ge-form, please input:

| ?- monitor(on).

Then you can get following ouputs for above example:

| ?- try(a or b).
Logic formulation :

 a or b

Display all process:
a or b

"ge", "le", "not"  form
 ge(1,2,[
    a,
    b ])

"ge" with "not" against atoms only
 ge(1,2,[
    a,
    b ])

"and" and "or" structures flattened
 ge(1,2,[
    a,
    b ])

IP formulation:

  a+b>=1

5. If you don't need the detailed message, please input:
| ?- monitor(off).

6.Some examples:

| ?- try(a and b -> c or d).
Logic formulation :

 a and b->c or d

IP formulation:

 -(a)-b+c+d>= -1
yes
| ?- try(a=<2 or b=<3 <-> e=<8 or f>=7).
Logic formulation :

 a=<2 or b=<3<->e=<8 or f>=7

IP formulation:

 conditional_cmpl(min(a-2)<0,a-2>=(min(a-2)-eps)*(1-d1)+eps)
 conditional_cmpl(min(b-3)<0,b-3>=(min(b-3)-eps)*(1-d1)+eps)
 conditional_cmpl(max(e-8)>0,e-8=<max(e-8)*(1-d2))
 conditional_cmpl(min(f-7)<0,f-7>=min(f-7)*(1-d3))
 d1+d2+d3>=1
 conditional_cmpl(min(e-8)<0,e-8>=(min(e-8)-eps)*(1-d4)+eps)
 conditional_cmpl(max(f-7)>0,f-7=<(max(f-7)+eps)*(1-d4)-eps)
 conditional_cmpl(max(a-2)>0,a-2=<max(a-2)*(1-d5))
 conditional_cmpl(max(b-3)>0,b-3=<max(b-3)*(1-d6))
 d4+d5+d6>=1

** where the "conditional_cmpl" means that the constraint (the bit after the ,)
should only be generated if the condition is true. the "eps" is to do with
turning the > into >=. 

| ?- try(a + b > 0 -> c >=e or f >=2).
Logic formulation :

 a+b>0->c>=e or f>=2

IP formulation:

 conditional_cmpl(max(a+b)>0,a+b=<max(a+b)*(1-d1))
 conditional_cmpl(min(c-e)<0,c-e>=min(c-e)*(1-d2))
 conditional_cmpl(min(f-2)<0,f-2>=min(f-2)*(1-d3))
 d1+d2+d3>=1

yes

| ?- try(ge(1,[a,le(2,[ge(1,[x,y,z]),le(2,[r,le(1,[ww,we,wr]),t]),b,c,d]),le(1,[e,f]),g])).
Logic formulation :

 ge(1,[a,le(2,[ge(1,[x,y,z]),le(2,[r,le(1,[ww,we,wr]),t]),b,c,d]),le(1,[e,f]),g])

IP formulation:

 -(x)-y-z-3*d2>= -3
 -(ww)-we-wr-2*d3>= -3
 r+t-2*d3>=0
 d2+d3-b-c-d-3*d1>= -3
 a+d1-e-f+g>= -1

yes
| ?- try(ge(1,[ge(2,[le(2,[p1,p2,p3,p4,p5]),
                              ge(4,[p6,p7,p8,p9,p10,p11])]),
                      ge(1,[p12,p13,p14]),
                      le(0,[p15,p16,p17])])).               
Logic formulation :

 ge(1,[ge(2,[le(2,[p1,p2,p3,p4,p5]),ge(4,[p6,p7,p8,p9,p10,p11])]),ge(1,[p12,p13,p14]),le(0,[p15,p16,p17])])

IP formulation:

 -(p1)-p2-p3-p4-p5-3*d1>= -5
 p6+p7+p8+p9+p10+p11-4*d1>=0
 -(p15)-p16-p17-3*d2>= -3
 d1+p12+p13+p14+d2>=1

yes







