Search in sources :

Example 1 with FuncDecl

use of com.microsoft.z3.FuncDecl in project batfish by batfish.

the class Z3ContextJob method mkFixedpoint.

protected Fixedpoint mkFixedpoint(NodProgram program, boolean printAnswer) {
    Context ctx = program.getNodContext().getContext();
    Params p = ctx.mkParams();
    p.add("timeout", _settings.getZ3timeout());
    p.add("fixedpoint.engine", "datalog");
    p.add("fixedpoint.datalog.default_relation", "doc");
    p.add("fixedpoint.print_answer", printAnswer);
    Fixedpoint fix = ctx.mkFixedpoint();
    fix.setParameters(p);
    for (FuncDecl relationDeclaration : program.getNodContext().getRelationDeclarations().values()) {
        fix.registerRelation(relationDeclaration);
    }
    for (BoolExpr rule : program.getRules()) {
        fix.addRule(rule, null);
    }
    return fix;
}
Also used : Context(com.microsoft.z3.Context) BoolExpr(com.microsoft.z3.BoolExpr) Fixedpoint(com.microsoft.z3.Fixedpoint) Params(com.microsoft.z3.Params) FuncDecl(com.microsoft.z3.FuncDecl)

Aggregations

BoolExpr (com.microsoft.z3.BoolExpr)1 Context (com.microsoft.z3.Context)1 Fixedpoint (com.microsoft.z3.Fixedpoint)1 FuncDecl (com.microsoft.z3.FuncDecl)1 Params (com.microsoft.z3.Params)1