Go to the first, previous, next, last section, table of contents.
In this mode, LIC
can be used to rapidly implement and test
linear inequality based algorithms used for loop level code generation.
The following is the command syntax for this mode.
-
Simple arithmetic operations are available for integers and integer
variables (see section Types of Variables) (
'+' '-' '*' '/'
).
-
Inequality systems can be created by describing the inequalities by the
variables used within the inequalities (see section Types of Variables).
A system of inequalities is described within square brackets
`[...]'. Each inequality should be separated by a new line.
iter = [ 0 <= ir <= U
0 <= jr <= U ]
decomp = [ 32*Pr <= ir < 32*Pr + L
32*Pw <= iw < 32*Pw + L ]
lwt = [ iw = 2*ir - 1
jw = jr ]
-
This program can also handle linear inequalities with symbolic
coefficients. However there are some restrictions. The systems should be
able to be solved using Fourier-Motzkin pair-wise elimination without
creating more complex coefficient terms other
than a coefficient with a single symbolic constant and an integer
multiplier. The first use of a variable that is used as a symbolic
coefficient has to clearly be a symbolic coefficient (see section Types of Variables). The terms with symbolic coefficients has to be of the form
<integer>*<symbolic coefficient>*<index variable> or
<symbolic coefficient>*<index variable>.
decomp = [ L*Pr <= i <= L*Pr + L - 1]
-
Multiple systems stored in Inequality variables as well as new systems
of inequalities can be concatenated by listing them
separated by commas (`,') or a new line. The entry should be
delimited by curly braces ({...}).
res = { iter, decomp, lwt }
nocomm = { res
[ Pr == Pw ] }
- S.realsol()
- realsol(S)
- S.rsol()
- rsol(S)
- S.rsolution()
- S.realsolution()
- realsolution(S)
All of these are equivalent and check if there exists a real solution to
the system of inequalities `S' using the Fourier-Motzkin
Elimination technique. This function returns an integer. The return
value is 1 if there exists a real solution, 0 otherwise.
- S.integersol()
- integersol(S)
- S.intsol()
- intsol(S)
- S.isol()
- isol(S)
- S.isolution()
- isolution(S)
- S.intsolution()
- intsolution(S)
- S.integersolution()
- integersolution(S)
All of these are equivalent and check if there exists an integer
solution to the system of inequalities `S' using Fourier-Motzkin
Elimination for elimination and a branch-and-bound technique to find an
integer solution. This function returns an integer. The return value is
1 if there exists a real solution, 0 otherwise. This function is only
available when there are no symbolic coefficients since branch-and-bound
is not currently implemented in the library of linear inequalities with
symbolic coefficients.
- S.project()
- S.proj()
These are equivalent and perform full pair-wise Fourier-Motzkin
elimination. The resulting system of inequalities will have all the
inequalities created while performing the Fourier-Motzkin pair-wise
elimination.
- S.project(ir)
- S.proj(ir)
These are equivalent and perform pair-wise Fourier-Motzkin elimination
for the variable `ir'. The variable `ir' should be a part of
the system `S'. The resulting system of inequalities will contain
all the inequalities of `S' that did not contain the variable
`ir'. The inequalities that contained the variable `ir' will
be replaced by the inequalities generated by pair-wise projection of
`ir'.
- S.simplify()
- S.simp()
These are equivalent and perform full pair-wise Fourier-Motzkin
elimination and eliminates all the redundant inequalities from the
resulting system. The heuristics used to eliminate the redundant
inequalities are the same as are used to find the tightest loop bounds.
- S.order(a b c d)
- S.ord(a b c d)
These are equivalent and cause the system of linear inequalities to be
ordered such that the variables are arranged from `a' to `d'.
This ordering is needed for the commands `project()',
`rename()' and `code()'. All the variables in the system
`S' have to be included in the ordering. For example,
S = S.order(i j k)
S.code()
will make the command `code()' treat the variable `i' as the
outer loop nest and variable `k' as the inner loop nest.
- S.rename(a b c d)
- S.ren(a b c d)
These are equivalent and cause the ordered system of inequalities to be
renamed using the new variables. All the variables in the system
`S' (except the symbolic coefficient variables) have to be renamed.
S = [ i > 2*j + k ]
S = S.order(i j k)
S = S.rename(p q k)
will result in an inequality
[p > 2*q + k]
- S.code()
- S.cd()
- S.code(n)
- S.cd(n)
All of these are equivalent and print the loop nest corresponding to the
system `S'. See order() for the format of the resulting loop nest.
If an integer value `n' is given, the first `n-1' variables,
i.e. outermost loop nests, will not be printed. This is used to avoid
printing loop nests for constant variables.
- merge()
- test()
These keywords are reserved for testing and debugging, and thus cannot
be used as variable names.
Go to the first, previous, next, last section, table of contents.