Commit e931dace authored by Salomon Sickert's avatar Salomon Sickert

fasdas

parent 3b197c42
......@@ -569,10 +569,10 @@ public final class DeterministicAutomaton<S, T> {
boolean contained;
if (type() == NormalFormType.DNF) {
contained = normalform.stream().anyMatch(x -> x.containsAll(index));
contained = normalform.stream().anyMatch(index::containsAll);
} else {
assert type() == NormalFormType.CNF;
contained = normalform.stream().anyMatch(index::containsAll);
contained = normalform.stream().anyMatch(x -> x.containsAll(index));
}
decomposedState.add(contained);
......
......@@ -176,10 +176,13 @@ class DeterministicAutomatonTest {
automaton.edges(2);
System.out.println(automaton.describeDecompose());
System.out.println(Arrays.toString(automaton.decompose(0)));
System.out.println(Arrays.toString(automaton.decompose(1)));
System.out.println(Arrays.toString(automaton.decompose(2)));
assertArrayEquals(new int[]{1, 0, 1, 0}, automaton.decompose(0));
assertArrayEquals(new int[]{1, 0, 1, 1}, automaton.decompose(1));
assertArrayEquals(new int[]{1, 1, 0, 0}, automaton.decompose(2));
assertArrayEquals(new int[]{1, 0, 1}, automaton.decompose(0));
assertArrayEquals(new int[]{1, 0, 1}, automaton.decompose(1));
assertArrayEquals(new int[]{1, 1, 0}, automaton.decompose(2));
}
@SuppressWarnings("PMD")
......@@ -203,6 +206,10 @@ class DeterministicAutomatonTest {
System.out.println(Arrays.toString(automaton.decompose(1)));
System.out.println(Arrays.toString(automaton.decompose(2)));
System.out.println(Arrays.toString(automaton.decompose(3)));
System.out.println(Arrays.toString(automaton.decompose(4)));
System.out.println(Arrays.toString(automaton.decompose(5)));
System.out.println(Arrays.toString(automaton.decompose(6)));
assertArrayEquals(new int[]{0, 0, 1, 0, 0, 0, 0}, automaton.decompose(0));
assertArrayEquals(new int[]{0, 1, 1, 0, 0, 1, 0}, automaton.decompose(1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment