|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Constraints.InclusionConstraints
InclusionConstraints
is a simple solver for inclusion
constraints. A system of inclusion constraints is a set of
constraints of the form "T1
included in
T2
" where each term
Ti
is either a variable or a set of atoms.
Here is a simple example:
V0
included in V1
{1, 2} included in V0
{3}
included in V1
Solving a system of inclusion constraints means finding a mapping
variable -> set of atoms such that when we replace each variable
with the corresponding set of atoms, all constraints are satisfied.
A possible solution for the previous constraint system is
V0 = {1, 2}, V1 = {1, 2, 3}
.
Here's another one
V0 = {1, 2, 100}, V1 = {1, 2, 3, 100, 1000}
.
We'll always study the least possible solution. Note that a
system of inclusion constraints can be unfeasible: just add the
constraint V1 included in {}
to the previous example.
Nested Class Summary | |
static class |
InclusionConstraints.AtomSet
Set of atoms term for the inclusion constraints. |
static class |
InclusionConstraints.Term
Root of the term class hierarchy. |
static class |
InclusionConstraints.TermVisitor
Visitor for Term . |
static class |
InclusionConstraints.Var
Variable for the inclusion constraints. |
Constructor Summary | |
InclusionConstraints()
|
Method Summary | |
void |
addConstraint(InclusionConstraints.Term t1,
InclusionConstraints.Term t2)
Adds the inclusion constraint t1 included in
t2 . |
Map |
solve()
Solves this system of inclusion constraints. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InclusionConstraints()
Method Detail |
public void addConstraint(InclusionConstraints.Term t1, InclusionConstraints.Term t2)
t1
included in
t2
. Each t
i can be either a variable
or a set of atoms.
InclusionConstraints.Var
,
InclusionConstraints.AtomSet
public Map solve() throws Unfeasible
this
system of inclusion constraints.
Unfeasible
- if the system is
unfeasible.
Unfeasible
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |