Go to the first, previous, next, last section, table of contents.


Creating a System and Checking for Solutions

In this example three systems of linear inequalities `t1', `t2' and `t3' are created. For each system `realsol()' checks if there exists a real solution and `intsol()' checks if there exists an integer solution.

t1 = [ 1 <= i <= N
       i <= j <= N ]
t1.realsol()
t1.intsol()

t2 = [ 10 <= i <= 20
        i <= j <= 5  ]
t2.realsol()
t2.intsol()

t3 = [ 1 <= i   <= 4
       1 <= 5*j <= i ]
t3.realsol()
t3.intsol()
end

The above script is created as an ascii file named example1. LIC is started with the rapid prototyping mode and the file example1 is given as the input script. The output is generated to standardout.

The following is a printout of the standardout for this session.

csh> lic -c
Rapid Prototyping System for Code Generation
> < example1
t1 = [ 1 <= i <= N
       i <= j <= N ]
N-j >= 0
j-i >= 0
N-i >= 0
-1+i >= 0

t1.realsol()
1
t1.intsol()
1

t2 = [ 10 <= i <= 20
        i <= j <= 5  ]
5-j >= 0
j-i >= 0
20-i >= 0
-10+i >= 0

t2.realsol()
0
t2.intsol()
0

t3 = [ 1 <= i   <= 4
       1 <= 5*j <= i ]
i-5*j >= 0
-1+5*j >= 0
4-i >= 0
-1+i >= 0

t3.realsol()
1
t3.intsol()
0
end

 > quit
done(0)

csh>


Go to the first, previous, next, last section, table of contents.