use of suite.lp.search.ProverBuilder.Builder in project suite by stupidsing.
the class LogicCompilerLevel2Test method test0.
// require tail recursion to work
@Test
public void test0() {
RuleSet rs = Suite.getRuleSet(Suite.parse(//
"" + //
"member (.e, _) .e #" + //
"member (_, .tail) .e :- member .tail .e #" + //
"sum .a .b .c :- bound .a, bound .b, let .c (.a - .b) #" + //
"sum .a .b .c :- bound .a, bound .c, let .b (.a - .c) #" + //
"sum .a .b .c :- bound .b, bound .c, let .a (.b + .c) #"));
Builder builder = CompiledProverBuilder.level2(new ProverConfig());
Suite.evaluateLogic(builder, rs, "(), sink ()");
}
use of suite.lp.search.ProverBuilder.Builder in project suite by stupidsing.
the class RbTreeTest method test.
@Test
public void test() throws IOException {
RuleSet rs = Suite.newRuleSet(List.of("auto.sl", "rbt.sl"));
String gs = //
"" + //
"rbt-insert-list (6, 7, 8, 9, 10, 1, 2, 3, 4, 5,) ()/.t \n" + //
", rbt-get .t 8" + ", rbt-member .t 4";
for (Builder builder : List.of(new InterpretedProverBuilder(), new SewingProverBuilder2())) assertTrue(Suite.proveLogic(builder, rs, gs));
}
use of suite.lp.search.ProverBuilder.Builder in project suite by stupidsing.
the class LogicCompilerLevel2Test method test1.
@Test
public void test1() throws IOException {
RuleSet rs = Suite.newRuleSet(List.of("auto.sl"));
Builder builder = CompiledProverBuilder.level2(new ProverConfig());
Suite.evaluateLogic(builder, rs, "(), sink ()");
}
use of suite.lp.search.ProverBuilder.Builder in project suite by stupidsing.
the class CompileUtil method precompile.
public boolean precompile(String libraryName, ProverConfig pc) {
System.out.println("Pre-compiling [" + libraryName + "]...");
Builder builder = new SewingProverBuilder(pc);
RuleSet rs = funCompilerRuleSet();
boolean b = Suite.proveLogic(builder, rs, "fc-precompile-lib " + libraryName);
if (b)
System.out.println("Pre-compilation success [" + libraryName + "]");
else
System.out.println("Pre-compilation failed [" + libraryName + "]");
return b;
}
Aggregations