|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTestWithAspartix
public class TestWithAspartix
A class to test the semantics-related functionality of DungAF
, using ASPARTIX (v.0.9).
This class allows the output of DungAF
to be checked against the output of ASPARTIX. One or
more semantics may be tested at a time, and the tests may involve any number of randomly-generated AFs of specified
dimensions (involving up to 26 arguments). ASPARTIX implements all of the semantics implemented by
DungAF
, except the eager semantics and the preferred-sceptical semantics.
This class requires that the DLV system is installed, and should be executed via a script. That script must -
DungAF
's interpretation of those AFs to results-files; DungAF
and ASPARTIX. Any disagreement between DungAF
and ASPARTIX is reported via the standard output stream,
along with details of the AF and the semantics involved.
Field Summary | |
---|---|
(package private) static String |
dlvDirectory
The name of the directory for the input-files for the DLV system. |
(package private) static HashSet<String> |
IMPLEM_SEMANTICS
The semantics implemented by DungAF . |
(package private) static int |
iterations
The number of AFs to be used in testing. |
(package private) static int |
maxArgs
The greatest number of arguments each AF may contain. |
(package private) static int |
maxAtts
The greatest number of attacks each AF may contain. |
(package private) static int |
minArgs
The least number of arguments each AF must contain. |
(package private) static int |
minAtts
The least number of attacks each AF must contain. |
(package private) static String |
resultsDirectory
The name of the directory for the results-files. |
(package private) static String[] |
semanticsToTest
The semantics with respect to which tests are to be done. |
(package private) static HashSet<String> |
UNIQUE_EXTENSION_SEMANTICS
The unique-extension semantics implemented by DungAF . |
Constructor Summary | |
---|---|
TestWithAspartix()
|
Method Summary | |
---|---|
private static boolean |
compareResults()
Compares interpretations of AFs provided by DungAF against interpretations provided by
ASPARTIX. |
static void |
main(String[] args)
Sets fields and calls writeFilesWithDungAF() or
compareResults() , depending on the second item in args . |
private static void |
writeFilesWithDungAF()
Generates AFs, writes those AFs to results-files and to input-files for the DLV system, and writes DungAF 's interpretations of those AFs to the results-files. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static int iterations
static int minArgs
static int maxArgs
static int minAtts
static int maxAtts
static String[] semanticsToTest
static final HashSet<String> UNIQUE_EXTENSION_SEMANTICS
DungAF
.
static final HashSet<String> IMPLEM_SEMANTICS
DungAF
.
static String dlvDirectory
static String resultsDirectory
Constructor Detail |
---|
public TestWithAspartix()
Method Detail |
---|
public static void main(String[] args) throws IllegalArgumentException
writeFilesWithDungAF()
or
compareResults()
, depending on the second item in args
. In the latter case, the
method also reports whether any discrepancies were found in the results, via the standard output stream.
args
- several String
s. This class must be executed twice by a script, as described
above. On the first occasion, at least 9 parameters are required, all but one of
which correspond to fields of this class -
iterations
); minArgs
must not exceed 26); maxArgs
); minAtts
); maxAtts
); dlvDirectory
); resultsDirectory
); IMPLEM_SEMANTICS
(semanticsToTest
); IMPLEM_SEMANTICS
(semanticsToTest
);
semanticsToTest
). IllegalArgumentException
- if the parameters are not as specified above.private static void writeFilesWithDungAF() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, IOException
DungAF
's interpretations of those AFs to the results-files.
The relevant fields determine the number and dimensions of the AFs which are generated.
IllegalAccessException
NoSuchMethodException
InvocationTargetException
IOException
private static boolean compareResults() throws FileNotFoundException, IOException
DungAF
against interpretations provided by
ASPARTIX. Details of any discrepancies are reported via the standard output stream.
The interpretations are read from the results-files which have been generated by
writeFilesWithDungAF()
and by the DLV system.
This method also deletes the (redundant) input-files generated by
writeFilesWithDungAF()
, but does not delete the results-files.
FileNotFoundException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |