本文整理汇总了Java中com.microsoft.z3.Context类的典型用法代码示例。如果您正苦于以下问题:Java Context类的具体用法?Java Context怎么用?Java Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Context类属于com.microsoft.z3包,在下文中一共展示了Context类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: check
import com.microsoft.z3.Context; //导入依赖的package包/类
private Model check(Context ctx, BoolExpr f, Status sat, Solver s){
try{
s.push();
s.add(f);
if (s.check() != sat){
s.pop();
return null;
}else if (sat == Status.SATISFIABLE){
Model ret = s.getModel();
s.pop();
return ret;
}else{
new java.lang.Exception().printStackTrace();
System.exit(1);
return null;
}
}catch(Exception e){
e.printStackTrace();
System.out.println("Hey dummy");
System.exit(1);
return null;
}
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:27,代码来源:SubsumptionHelper.java
示例2: test
import com.microsoft.z3.Context; //导入依赖的package包/类
@Test
public void test() {
final Context context = new Context();
final Solver solver = context.mkSimpleSolver();
final BoolExpr a = context.mkBoolConst("a");
final BoolExpr b = context.mkBoolConst("b");
final BoolExpr expr = context.mkOr(a, b);
solver.add(expr);
solver.check();
final Model model = solver.getModel();
System.out.println(model.getConstInterp(a));
System.out.println(model.getConstInterp(b));
context.close();
}
开发者ID:FTSRG,项目名称:theta,代码行数:19,代码来源:Z3ModelTest.java
示例3: NativeZ3Solver
import com.microsoft.z3.Context; //导入依赖的package包/类
public NativeZ3Solver(int to, Map<String, String> properties) {
this.timeout = to;
this.options = properties;
Map<String, String> cfg = Collections.singletonMap("model", "true");
for (Entry<String, String> o : options.entrySet()) {
Global.setParameter(o.getKey(), o.getValue());
}
try {
this.ctx = new Context(cfg);
defaultContext = createContext();
} catch (Z3Exception ex) {
if (ctx != null) {
try {
ctx.dispose();
} catch (Throwable t) {
}
}
throw new RuntimeException(ex);
}
}
开发者ID:psycopaths,项目名称:jconstraints-z3,代码行数:23,代码来源:NativeZ3Solver.java
示例4: firstCheckSatAndGetModel
import com.microsoft.z3.Context; //导入依赖的package包/类
public @NonNull Z3Model firstCheckSatAndGetModel(@NonNull String smtEncoding) {
Map<String, String> config = new HashMap<>();
config.put("model", "true");
try {
context = new Context(config);
solver = context.mkSolver();
sorts = new ArrayDeque<>();
decls = new ArrayDeque<>();
return runCheckSatAndGetModel(smtEncoding);
}
catch (Z3Exception e) {
MMINTException.print(IStatus.WARNING, "Z3 problem, returning unknown result and resetting the solver", e);
reset();
return new Z3Model(Status.UNKNOWN, null);
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:19,代码来源:Z3IncrementalSolver.java
示例5: ModelZ3JavaService
import com.microsoft.z3.Context; //导入依赖的package包/类
public ModelZ3JavaService(Green solver, Properties properties) {
super(solver);
HashMap<String, String> cfg = new HashMap<String, String>();
cfg.put("model", "true");
try{
ctx = new Context(cfg);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("## Error Z3: Exception caught in Z3 JNI: \n" + e);
}
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:12,代码来源:ModelZ3JavaService.java
示例6: SATZ3JavaService
import com.microsoft.z3.Context; //导入依赖的package包/类
public SATZ3JavaService(Green solver, Properties properties) {
super(solver);
HashMap<String, String> cfg = new HashMap<String, String>();
cfg.put("model", "true");
try{
ctx = new Context(cfg);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("## Error Z3: Exception caught in Z3 JNI: \n" + e);
}
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:12,代码来源:SATZ3JavaService.java
示例7: SubsumptionHelper
import com.microsoft.z3.Context; //导入依赖的package包/类
public SubsumptionHelper(){
cfgModel = new HashMap<String, String>();
cfgModel.put("model", "true");
try{
mainCtx = new Context(cfgModel);
mainSolver = mainCtx.mkSolver();
}catch(Z3Exception e){
e.printStackTrace();
System.exit(1);
}
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:13,代码来源:SubsumptionHelper.java
示例8: Z3DeclTransformer
import com.microsoft.z3.Context; //导入依赖的package包/类
Z3DeclTransformer(final Z3TransformationManager transformer, final Z3SymbolTable symbolTable,
final Context context) {
this.transformer = transformer;
this.symbolTable = symbolTable;
this.context = context;
this.symbolCount = 0;
}
开发者ID:FTSRG,项目名称:theta,代码行数:8,代码来源:Z3DeclTransformer.java
示例9: Z3TypeTransformer
import com.microsoft.z3.Context; //导入依赖的package包/类
Z3TypeTransformer(final Z3TransformationManager transformer, final Context context) {
this.context = context;
this.transformer = transformer;
boolSort = context.mkBoolSort();
intSort = context.mkIntSort();
realSort = context.mkRealSort();
}
开发者ID:FTSRG,项目名称:theta,代码行数:9,代码来源:Z3TypeTransformer.java
示例10: NativeZ3ExpressionGenerator
import com.microsoft.z3.Context; //导入依赖的package包/类
public NativeZ3ExpressionGenerator(Context ctx, Solver solver)
throws Z3Exception {
this.ctx = ctx;
this.solver = solver;
this.protect = new HashSet<IDisposable>();
this.tainted = (BoolExpr)ctx.mkFreshConst("__tainted", ctx.getBoolSort());
this.protect.add(tainted);
this.own.add(tainted);
this.variables = new HashMap<Variable<?>, Expr>();
this.count = 0;
}
开发者ID:psycopaths,项目名称:jconstraints-z3,代码行数:13,代码来源:NativeZ3ExpressionGenerator.java
示例11: loadSMTLIBEncoding
import com.microsoft.z3.Context; //导入依赖的package包/类
private Solver loadSMTLIBEncoding(Map<String, String> config, String smtEncoding) throws Z3Exception {
Context context = new Context(config);
Solver solver = context.mkSolver();
BoolExpr expr = context.parseSMTLIB2String(smtEncoding, null, null, null, null);
solver.add(expr);
return solver;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:10,代码来源:Z3Solver.java
示例12: setUp
import com.microsoft.z3.Context; //导入依赖的package包/类
@Before
public void setUp() {
ctx = new Context();
}
开发者ID:paulp,项目名称:pspz3,代码行数:5,代码来源:TestRules.java
示例13: Z3JavaTranslator
import com.microsoft.z3.Context; //导入依赖的package包/类
public Z3JavaTranslator(Context c) {
this.context = c;
stack = new Stack<Expr>();
v2e = new HashMap<Variable, Expr>();
domains = new LinkedList<BoolExpr>();
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:7,代码来源:Z3JavaTranslator.java
示例14: exploreExpression
import com.microsoft.z3.Context; //导入依赖的package包/类
private BoolExpr exploreExpression(Expression e, Context ctx) throws Z3Exception{
Explorer ex = new Explorer(ctx);
return ex.explore(e);
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:5,代码来源:SubsumptionHelper.java
示例15: Explorer
import com.microsoft.z3.Context; //导入依赖的package包/类
public Explorer(Context ctx){
this.ctx = ctx;
this.stack = new Stack<Expr>();
}
开发者ID:holycrap872,项目名称:green-solver,代码行数:5,代码来源:SubsumptionHelper.java
示例16: Z3TransformationManager
import com.microsoft.z3.Context; //导入依赖的package包/类
public Z3TransformationManager(final Z3SymbolTable symbolTable, final Context context) {
this.typeTransformer = new Z3TypeTransformer(this, context);
this.declTransformer = new Z3DeclTransformer(this, symbolTable, context);
this.exprTransformer = new Z3ExprTransformer(this, context);
}
开发者ID:FTSRG,项目名称:theta,代码行数:6,代码来源:Z3TransformationManager.java
示例17: getContext
import com.microsoft.z3.Context; //导入依赖的package包/类
Context getContext() {
return ctx;
}
开发者ID:psycopaths,项目名称:jconstraints-z3,代码行数:4,代码来源:NativeZ3Solver.java
示例18: SolverWrapperZ3
import com.microsoft.z3.Context; //导入依赖的package包/类
public SolverWrapperZ3() throws Z3Exception{
Map<String, String> cfg = new HashMap<String, String>();
ctx = new Context(cfg);
sootVarToZ3Var = new HashMap<Value,IntExpr>();
}
开发者ID:BoiseState,项目名称:Disjoint-Domains,代码行数:6,代码来源:SolverWrapperZ3.java
注:本文中的com.microsoft.z3.Context类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论