Search in sources :

Example 1 with Specializer

use of suite.lp.doer.Specializer in project suite by stupidsing.

the class LogicCompilerLevel1Test method testCompileFunProgram.

/**
 * Compiles the functional compiler and use it to compile a simple functional
 * program.
 */
@Test
public void testCompileFunProgram() {
    RuleSet rs = Suite.newRuleSet(List.of("auto.sl", "fc/fc.sl"));
    String gs = // 
    "" + // 
    "source .in" + // 
    ", compile-function .0 .in .out" + ", sink .out";
    Node goal = new Specializer().specialize(Suite.substitute(gs, Atom.of("LAZY")));
    Node input = Suite.parse("1 + 2");
    Node result = FindUtil.collectSingle(finder(rs, goal), input);
    System.out.println(result);
    assertNotNull(result);
}
Also used : RuleSet(suite.lp.kb.RuleSet) Specializer(suite.lp.doer.Specializer) Node(suite.node.Node) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Specializer (suite.lp.doer.Specializer)1 RuleSet (suite.lp.kb.RuleSet)1 Node (suite.node.Node)1