Commit 69a10263 authored by Sergio Pérez's avatar Sergio Pérez
Browse files

Structural Constraint Removal

parent 333afe00
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -89,9 +89,6 @@ public abstract class AccessConstraint extends EdgeConstraint {

		return super.wrap(super.push(phase, constraints));
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) {
		return super.wrap();
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth){
		if (this.operation == Operation.Add)
			return super.wrap(super.push(phase, constraints));
+1 −4
Original line number Diff line number Diff line
@@ -40,10 +40,7 @@ public class AddNodeConstraint extends EdgeConstraint {
		constraints.nodeConstraints.add(this.nodeConstraint);
		return super.wrap(constraints);
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) {
		constraints.nodeConstraints.add(this.nodeConstraint);
		return super.wrap(constraints);
	}

	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth) {
		constraints.nodeConstraints.add(this.nodeConstraint);
		return super.wrap(constraints);
+0 −18
Original line number Diff line number Diff line
@@ -56,25 +56,7 @@ public class AsteriskConstraint extends EdgeConstraint
		final EdgeConstraint peekConstraint = newConstraints.peekEdgeConstraint();
		return super.resolve(phase, edg, edge, newConstraints, peekConstraint, productionDepth);
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) {
		if (phase.isInstanceof(Phase.Slicing))
			return super.wrap(new Constraints());
		super.check(phase, Phase.SummaryGeneration);

		if (existsPreviousAsteriskConstraint(constraints))
			return super.wrap(this.popToAsteriskConstraint(constraints));

		if (topConstraint.getConstraint().operation == AccessConstraint.Operation.Remove)
			return super.wrap(super.push(phase, constraints));
		super.check(topConstraint.getConstraint().operation, AccessConstraint.Operation.Add);

		final Constraints newConstraints = super.pop(constraints);
		if (newConstraints.isEdgeConstraintsEmpty())
			return super.wrap(newConstraints);

		final EdgeConstraint peekConstraint = newConstraints.peekEdgeConstraint();
		return super.resolve(phase, edg, edge, newConstraints, peekConstraint, productionDepth);
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth) {
		if (phase.isInstanceof(Phase.Slicing))
			return super.wrap(new Constraints());
+0 −3
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@ public abstract class EdgeConstraint extends Constraint
			return this.resolve(phase, edg, edge, constraints, (ListComprehensionConstraint) topConstraint, productionDepth);
		else if (topConstraint instanceof AccessConstraint)
			return this.resolve(phase, edg, edge, constraints, (AccessConstraint) topConstraint, productionDepth);
		else if (topConstraint instanceof StructuralConstraint)
			return this.resolve(phase, edg, edge, constraints, (StructuralConstraint) topConstraint, productionDepth);
		else if (topConstraint instanceof LiteralConstraint)
			return this.resolve(phase, edg, edge, constraints, (LiteralConstraint) topConstraint, productionDepth);
		else if (topConstraint instanceof EmptyConstraint)
@@ -37,7 +35,6 @@ public abstract class EdgeConstraint extends Constraint

	protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, int productionDepth);
	protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AccessConstraint topConstraint, int productionDepth);
	protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth);
	protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth);

	protected final List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AddNodeConstraint topConstraint, int productionDepth)
+0 −4
Original line number Diff line number Diff line
@@ -36,10 +36,6 @@ public class EmptyConstraint extends EdgeConstraint
	{
		return super.wrap(constraints);
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth)
	{
		return super.wrap(constraints);
	}
	protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth){
		return super.wrap(constraints);
	}
Loading