本文整理汇总了C#中Z3Provider.MkNot方法的典型用法代码示例。如果您正苦于以下问题:C# Z3Provider.MkNot方法的具体用法?C# Z3Provider.MkNot怎么用?C# Z3Provider.MkNot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Z3Provider
的用法示例。
在下文中一共展示了Z3Provider.MkNot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MintermBlowupTestHelperMoore
private static int MintermBlowupTestHelperMoore(int K)
{
var z3p = new Z3Provider(BitWidth.BV32);
var x = z3p.CharVar;
var zero = z3p.MkNumeral(0, z3p.CharSort);
Func<int, Expr> gamma = k =>
{
int kth = 1 << k;
Expr mask = z3p.MkNumeral(kth, z3p.CharSort);
Expr cond = z3p.MkNot(z3p.MkEq(z3p.MkBvAnd(x, mask), zero));
return cond;
};
var moves = new List<Move<Expr>>();
for (int i = 0; i < K; i++)
moves.Add(Move<Expr>.Create(i, i + 1, gamma(i)));
for (int i = 0; i < K; i++)
moves.Add(Move<Expr>.Create(i == 0 ? 0 : K + i, K + i + 1, i ==0 ? z3p.MkNot(gamma(i)) : gamma(i)));
var aut = Automaton<Expr>.Create(z3p, 0, new int[] { K, 2 * K }, moves);
var sfa = new SFA<FuncDecl, Expr, Sort>(z3p, z3p.CharSort, aut);
sfa.Automaton.CheckDeterminism(true);
int t = System.Environment.TickCount;
var autmin = sfa.Automaton.MinimizeMoore();
t = System.Environment.TickCount - t;
return t;
}
示例2: SFAtest2
public void SFAtest2()
{
Z3Provider solver = new Z3Provider();
string a = @"^[A-Za-z0-9][email protected](([A-Za-z0-9\-])+\.)+([A-Za-z\-])+$"; //.Net regex
string b = @"^\d.*$"; //.Net regex
//corresponding SFAs
var A = new SFAz3(solver, solver.CharacterSort, solver.RegexConverter.Convert(a));
var B = new SFAz3(solver, solver.CharacterSort, solver.RegexConverter.Convert(b));
A.AssertTheory(); //assert the theories of both SFAs to the solver
B.AssertTheory();
//declare a new uninterpreted constant of sort List<character>
Expr inputConst = solver.MkFreshConst("input", A.InputListSort);
//get a solution for input so that it is accepted by A but not by B
var assertion = solver.MkAnd(A.MkAccept(inputConst),
solver.MkNot(B.MkAccept(inputConst)));
var model = solver.MainSolver.GetModel(assertion, inputConst);
string input = model[inputConst].StringValue; //actual witness in L(A)-L(B)
}