Class TestUtil


  • public class TestUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      TestUtil()  
    • Method Summary

      Modifier and Type Method Description
      private static java.lang.Boolean charToBool​(char ch)  
      static boolean equalInterpretations​(Interpretation interpretation, java.util.Map<java.lang.String,​java.lang.Boolean> map)
      Checks if the different representations of interpretations are equal, i.e.
      static void mergeSolutionFiles​(java.lang.String dir, java.lang.String[] semantics, java.lang.String outputExtension)
      Merges the solution files from solvers like diamond or k++adf into a single one.
      static java.util.Map<java.lang.String,​java.util.List<java.util.Map<java.lang.String,​java.lang.Boolean>>> readSolutionFile​(java.io.File file)
      Reads all models from the given solution file and groups them by their semantics.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_SOLUTION_EXTENSION

        public static final java.lang.String DEFAULT_SOLUTION_EXTENSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • TestUtil

        public TestUtil()
    • Method Detail

      • mergeSolutionFiles

        public static void mergeSolutionFiles​(java.lang.String dir,
                                              java.lang.String[] semantics,
                                              java.lang.String outputExtension)
                                       throws java.io.IOException
        Merges the solution files from solvers like diamond or k++adf into a single one. Allows us to keep the number of files per instance much lower since we must not store the models in a separate file for each semantics.
        Parameters:
        dir - the path
        semantics - the used semantics
        outputExtension - some string
        Throws:
        java.io.IOException - if some IO issue occurs
      • readSolutionFile

        public static java.util.Map<java.lang.String,​java.util.List<java.util.Map<java.lang.String,​java.lang.Boolean>>> readSolutionFile​(java.io.File file)
                                                                                                                                              throws java.io.IOException
        Reads all models from the given solution file and groups them by their semantics.
        Parameters:
        file - the solution file
        Returns:
        a mapping of all the models per semantic
        Throws:
        java.io.IOException - if an IO issue occurs
      • charToBool

        private static java.lang.Boolean charToBool​(char ch)
      • equalInterpretations

        public static boolean equalInterpretations​(Interpretation interpretation,
                                                   java.util.Map<java.lang.String,​java.lang.Boolean> map)
        Checks if the different representations of interpretations are equal, i.e. all assignments are equal.
        Parameters:
        interpretation - some interpretation
        map - some map from string to boolean
        Returns:
        true if the different representations of interpretations are equal