|
|
@ -27,6 +27,7 @@ |
|
|
|
|
|
|
|
|
package acceptance; |
|
|
package acceptance; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.PrintStream; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.BitSet; |
|
|
import java.util.BitSet; |
|
|
import java.util.Collections; |
|
|
import java.util.Collections; |
|
|
@ -363,5 +364,53 @@ public class AcceptanceGeneric implements AcceptanceOmega { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void outputHOAHeader(PrintStream out) |
|
|
|
|
|
{ |
|
|
|
|
|
List<AcceptanceGeneric> leafNodes = getLeafNodes(); |
|
|
|
|
|
out.print("Acceptance: "+leafNodes.size()+" "); |
|
|
|
|
|
outputHOAFormula(out, 0); |
|
|
|
|
|
out.println(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int outputHOAFormula(PrintStream out, int nextSetIndex) |
|
|
|
|
|
{ |
|
|
|
|
|
switch (kind) { |
|
|
|
|
|
case AND: |
|
|
|
|
|
out.print("("); |
|
|
|
|
|
nextSetIndex = left.outputHOAFormula(out, nextSetIndex); |
|
|
|
|
|
out.print(")&("); |
|
|
|
|
|
nextSetIndex = right.outputHOAFormula(out, nextSetIndex); |
|
|
|
|
|
out.print(")"); |
|
|
|
|
|
return nextSetIndex; |
|
|
|
|
|
case OR: |
|
|
|
|
|
out.print("("); |
|
|
|
|
|
nextSetIndex = left.outputHOAFormula(out, nextSetIndex); |
|
|
|
|
|
out.print(")|("); |
|
|
|
|
|
nextSetIndex = right.outputHOAFormula(out, nextSetIndex); |
|
|
|
|
|
out.print(")"); |
|
|
|
|
|
return nextSetIndex; |
|
|
|
|
|
case TRUE: |
|
|
|
|
|
out.print("t"); |
|
|
|
|
|
return nextSetIndex; |
|
|
|
|
|
case FALSE: |
|
|
|
|
|
out.print("f"); |
|
|
|
|
|
return nextSetIndex; |
|
|
|
|
|
case FIN: |
|
|
|
|
|
out.print("Fin("+nextSetIndex+")"); |
|
|
|
|
|
return nextSetIndex+1; |
|
|
|
|
|
case FIN_NOT: |
|
|
|
|
|
out.print("Fin(!"+nextSetIndex+")"); |
|
|
|
|
|
return nextSetIndex+1; |
|
|
|
|
|
case INF: |
|
|
|
|
|
out.print("Inf("+nextSetIndex+")"); |
|
|
|
|
|
return nextSetIndex+1; |
|
|
|
|
|
case INF_NOT: |
|
|
|
|
|
out.print("Inf(!"+nextSetIndex+")"); |
|
|
|
|
|
return nextSetIndex+1; |
|
|
|
|
|
} |
|
|
|
|
|
throw new UnsupportedOperationException("Unknown kind"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |