@@ -0,0 +1,1259 @@
+package hu.webarticum.jsatbuilder.satbuilder.common;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport hu.webarticum.jsatbuilder.sat.Solver;%0Aimport hu.webarticum.jsatbuilder.satbuilder.core.AbstractConstraint;%0Aimport hu.webarticum.jsatbuilder.satbuilder.core.CollapseException;%0Aimport hu.webarticum.jsatbuilder.satbuilder.core.Definition;%0A%0Apublic class CauseConstraint extends AbstractConstraint %7B%0A    %0A    private Definition cause;%0A    private Definition effect;%0A    %0A    public CauseConstraint(Definition cause, Definition effect) %7B%0A        this(cause, effect, false);%0A    %7D%0A%0A    public CauseConstraint(Definition cause, Definition effect, boolean required) %7B%0A        super(required);%0A        getDependencyManager().linkDependency(cause);%0A        getDependencyManager().linkDependency(effect);%0A    %7D%0A%0A    @Override%0A    public void fillSolver(Solver solver) %7B%0A        solver.add(new Solver.Clause(%0A            new Solver.Literal(cause, false),%0A            new Solver.Literal(effect, true)%0A        ));%0A    %7D%0A    %0A    @Override%0A    public List%3CDefinition%3E getDependencies() %7B%0A        return Arrays.asList(cause, effect);%0A    %7D%0A%0A    @Override%0A    public void dependencyRemoved(Definition definition) throws CollapseException %7B%0A        remove();%0A    %7D%0A%0A%7D%0A

Add CauseConstraint