-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Many changes, mostly related to testing
Added test to compare runtimes of standard incremental and incremental with neq initialized to only contain final/non-final pairs of states and started refactoring tests to perform multiple trials.
- Loading branch information
Showing
8 changed files
with
540 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
IncrementalMinimization/src/minimization/incremental/IncrSimpleNEQ.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package minimization.incremental; | ||
|
||
import java.util.Comparator; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
|
||
import org.sat4j.specs.TimeoutException; | ||
|
||
import theory.BooleanAlgebra; | ||
import automata.sfa.SFA; | ||
|
||
/* | ||
* CLASS FOR TESTING PURPOSES ONLY | ||
* | ||
* This class uses a naive non-equivalence check that initially only checks | ||
* whether or not the given pair contains one final and one non-final state. | ||
*/ | ||
|
||
public class IncrSimpleNEQ<P,S> extends IncrementalMinimization<P,S> | ||
{ | ||
protected class StateComparatorSimple extends StateComparator | ||
{ | ||
@Override | ||
public int compare(Integer a, Integer b) | ||
{ | ||
return a-b; | ||
} | ||
} | ||
|
||
public IncrSimpleNEQ(SFA<P, S> aut, BooleanAlgebra<P, S> ba) throws TimeoutException | ||
{ | ||
super(aut, ba); | ||
this.stateComp = new StateComparatorSimple(); | ||
for(Integer p : aut.getFinalStates()) | ||
{ | ||
for(Integer q : aut.getNonFinalStates()) | ||
{ | ||
neq.add(normalize(p,q)); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
protected LinkedHashMap<Integer, Integer> generateDistanceToFinalMap() | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
protected Integer getStateDistanceToFinal(Integer state) | ||
{ | ||
return 0; | ||
} | ||
|
||
@Override | ||
protected boolean isKnownNotEqual(Integer p, Integer q) | ||
{ | ||
List<Integer> normalizedPair = normalize(p,q); | ||
return neq.contains(normalizedPair); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.