assertFalse("Maude process finished.",maudePB.isRunning());
}
public void testFullMaude() {
IMaudeProcessBatch maudePB = MaudeDaemonPlugin.getDefault().getNewMaudeProcessBatch();
maudePB.configMaudeFromPrefs();
maudePB.setAutoConfig(false);
maudePB.setFullMaude();
try {
maudePB.execMaude();
} catch (IOException e) {
e.printStackTrace();
}
assertTrue("Maude is running.",maudePB.isRunning());
assertTrue("Maude is running in Full Maude mode.",maudePB.isFullMaude());
String fullMaudeCommands =
"(fth FUNCTION(X :: TRIV | Y :: TRIV) is\n" +
" op f : X@Elt -> Y@Elt .\n" +
"endfth)\n" +
"(fmod FMAP(F :: FUNCTION(X :: TRIV | Y :: TRIV)) is\n" +
" sorts IndSet(X) DepSet(Y) .\n" +
" subsort X@Elt < IndSet(X) .\n" +
" subsort Y@Elt < DepSet(Y) .\n" +
" op __ : IndSet(X) IndSet(X) -> IndSet(X) [ctor assoc comm id: ind-null] .\n" +
" op _;_ : DepSet(Y) DepSet(Y) -> DepSet(Y) [ctor assoc comm id: dep-null] .\n" +
" op ind-null : -> IndSet(X) [ctor] .\n" +
" op dep-null : -> DepSet(Y) [ctor] .\n" +
" op fmap : IndSet(X) -> DepSet(Y) .\n" +
" var N : X@Elt . var NS : IndSet(X) .\n" +
" eq fmap(N NS) = f(N) ; fmap(NS) .\n" +
" eq fmap(ind-null) = dep-null .\n" +
"endfm)\n" +
"(fmod NEGATIVE is\n" +
" pr NAT . pr INT .\n" +
" op _timesneg1 : Nat -> Int .\n" +
" var N : Nat .\n" +
" eq N timesneg1 = - N .\n" +
"endfm)\n" +
"(view Triv-Nat from TRIV to NAT is sort Elt to Nat . endv)\n" +
"(view Triv-Int from TRIV to INT is sort Elt to Int . endv)\n" +
"(view Fun-Neg(X :: TRIV | Y :: TRIV) from FUNCTION(X | Y) to NEGATIVE is\n" +
" op f to _timesneg1 .\n" +
"endv)\n" +
"(red in FMAP(Fun-Neg(Triv-Nat | Triv-Int)) : fmap(5 9 11 2 0) .)\n";
try {
List<IMaudeJob> mjs = maudePB.createAndRunJobs(fullMaudeCommands);
maudePB.waitUntilFinish();
for (IMaudeJob mj : mjs) {
System.out.println("Processing job:");
System.out.println(mj.getInput());
System.out.println("Raw result:");
System.out.println(mj.getOut());
System.out.println("Filtered result:");
System.out.println(mj.getResult());
System.out.println("Error messages:");
System.out.println(mj.getError());
System.out.println("=====================================================\n\n");
}
} catch (ParseException e) {
e.printStackTrace();
}
maudePB.quitMaude();
assertFalse("Maude process finished.",maudePB.isRunning());
}