jpaul.Constraints.SetConstraints
Class CtDiffConstraint<T>
java.lang.Object
jpaul.Constraints.Constraint<SVar<T>,java.util.Set<T>>
jpaul.Constraints.SetConstraints.FilterConstraint<T>
jpaul.Constraints.SetConstraints.CtDiffConstraint<T>
public class CtDiffConstraint<T>
- extends FilterConstraint<T>
CtDiffConstraint
models a "difference with a constant set" constraint.
Mathematically, such a constraint has the form:
vIn \ ctSet <= vDest
where /\
stands for set intersection,
<=
stands for set inclusion, vIn
and
vDest
are set-valued variables, and ctSet
is a constant set.
- Version:
- $Id: CtDiffConstraint.java,v 1.5 2006/03/14 02:29:30 salcianu Exp $
- Author:
- Alexandru Salcianu - salcianu@alum.mit.edu
Constructor Summary |
CtDiffConstraint(SVar<T> vIn,
java.util.Collection<T> ctSet,
SVar<T> vDest)
Creates a CtDiffConstraint with the meaning
vIn \ ctSet <= vDest . |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CtDiffConstraint
public CtDiffConstraint(SVar<T> vIn,
java.util.Collection<T> ctSet,
SVar<T> vDest)
- Creates a
CtDiffConstraint
with the meaning
vIn \ ctSet <= vDest
. This constructor does
not construct a private copy of ctSet
, so you may
want to pass it an exclusive copy of ctSet
.
rewrite
public Constraint<SVar<T>,java.util.Set<T>> rewrite(UnionFind<SVar<T>> uf)
- We implemented
rewrite(jpaul.DataStructs.UnionFind>)
, equals(java.lang.Object)
, and hashCode
, such that constraints that are identical after
variable unification are not duplicated needlessly.
- Overrides:
rewrite
in class Constraint<SVar<T>,java.util.Set<T>>
- Parameters:
uf
- Union-find structure; for each variable
v
, uf.find(v)
is the representative
of its equivalence class.
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class FilterConstraint<T>
Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu