Search in sources :

Example 6 with PartialFunctionDecl

use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.

the class PartialFunctionTest method unusedFunctionNotRemoved.

@Test
public void unusedFunctionNotRemoved() {
    Model model = expand(parse("", applyFunction()));
    PartialFunctionDecl decl = getPartialFunction(model, "apply");
    assertNotNull("Unused pardef 'apply' has been removed!", decl);
}
Also used : Model(org.abs_models.frontend.ast.Model) PartialFunctionDecl(org.abs_models.frontend.ast.PartialFunctionDecl) Test(org.junit.Test)

Example 7 with PartialFunctionDecl

use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.

the class PartialFunctionTest method noMaudeCodeGenerated.

@Test
public void noMaudeCodeGenerated() throws NotImplementedYetException, UnsupportedEncodingException {
    Model model = testExpand(parse("apply(inc)(0);", applyFunction(), incFunction()), "apply_%s_inc__");
    PartialFunctionDecl func = getPartialFunction(model, "apply");
    assertNotNull(func);
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    func.generateMaude(new PrintStream(os));
    assertEquals("", os.toString("utf-8"));
}
Also used : PrintStream(java.io.PrintStream) Model(org.abs_models.frontend.ast.Model) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PartialFunctionDecl(org.abs_models.frontend.ast.PartialFunctionDecl) Test(org.junit.Test)

Aggregations

Model (org.abs_models.frontend.ast.Model)7 PartialFunctionDecl (org.abs_models.frontend.ast.PartialFunctionDecl)7 Test (org.junit.Test)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 PrintStream (java.io.PrintStream)4 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1 DefaultABSFormatter (org.abs_models.backend.prettyprint.DefaultABSFormatter)1 ReachabilityInformation (org.abs_models.backend.prolog.ReachabilityInformation)1