use of com.google.cloud.dialogflow.v2.Context in project bmoth by hhu-stups.
the class InvariantSatisfiabilityChecker method doInvariantSatisfiabilityCheck.
static InvariantSatisfiabilityCheckingResult doInvariantSatisfiabilityCheck(MachineNode machine) {
Context ctx = new Context();
Solver solver = Z3SolverFactory.getZ3Solver(ctx);
MachineToZ3Translator machineTranslator = new MachineToZ3Translator(machine, ctx);
final BoolExpr invariant = machineTranslator.getInvariantConstraint();
solver.add(invariant);
Status check = solver.check();
return new InvariantSatisfiabilityCheckingResult(check);
}
use of com.google.cloud.dialogflow.v2.Context in project bmoth by hhu-stups.
the class Issue59Test method testIssue59JustInvariant.
@Test
public void testIssue59JustInvariant() {
Context ctx = new Context();
Solver s = ctx.mkSolver();
String formula = "x**2 = x*x & #x.({x} \\/ {1,2} = {1,2})";
BoolExpr combinedConstraint = FormulaToZ3Translator.translatePredicate(formula, ctx);
s.add(combinedConstraint);
Status check = s.check();
assertEquals(Status.SATISFIABLE, check);
}
use of com.google.cloud.dialogflow.v2.Context in project bmoth by hhu-stups.
the class Issue59Test method testIssue59JustInvariant2.
@Test
public void testIssue59JustInvariant2() {
Context ctx = new Context();
Solver s = ctx.mkSolver();
String formula = "x**2 = x*x";
BoolExpr combinedConstraint = FormulaToZ3Translator.translatePredicate(formula, ctx);
s.add(combinedConstraint);
Status check = s.check();
assertEquals(Status.SATISFIABLE, check);
}
use of com.google.cloud.dialogflow.v2.Context in project bmoth by hhu-stups.
the class TestUsingZ3 method setup.
@Before
public void setup() {
z3Context = new Context();
z3Solver = z3Context.mkSolver();
}
use of com.google.cloud.dialogflow.v2.Context in project kie-wb-common by kiegroup.
the class ContextPropertyConverter method wbFromDMN.
public static Context wbFromDMN(final org.kie.dmn.model.v1_1.Context dmn) {
Id id = new Id(dmn.getId());
Description description = new Description(dmn.getDescription());
QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
Context result = new Context(id, description, typeRef);
for (org.kie.dmn.model.v1_1.ContextEntry ce : dmn.getContextEntry()) {
ContextEntry ceConverted = ContextEntryPropertyConverter.wbFromDMN(ce);
result.getContextEntry().add(ceConverted);
}
return result;
}
Aggregations