예제 #1
0
        private ISolverStatement MakeNegatedAndCombinations(List<Term> terms)
        {
            //Variables
            List<Term> negatedAnds = new List<Term>();
            ISolverStatement finalStatement = null;

            //
            for (int i = 0; i < terms.Count; i++)
            {
                for (int j = i + 1; j < terms.Count; j++)
                {
                    negatedAnds.Add(_context.MkNot(_context.MkAnd(terms[i], terms[j])));
                }
            }
            if (negatedAnds.Count > 1)
                finalStatement = new Z3Statement(_context.MkAnd(negatedAnds.ToArray()));
            else
                finalStatement = new Z3Statement(negatedAnds[0]);

            //
            return finalStatement;
        }
예제 #2
0
        public ISolverStatement MakeLowerOrEqual(ISolverStatement leftStatement, ISolverStatement rightStatement)
        {
            //Variables
            ISolverStatement finalStatement = null;
            Term leftTerm = ((Z3Statement)leftStatement).Term;
            Term rightTerm = ((Z3Statement)rightStatement).Term;

            //
            finalStatement = new Z3Statement(_context.MkLe(leftTerm, rightTerm));
            return finalStatement;
        }
예제 #3
0
        public ISolverStatement MakeNegation(ISolverStatement innerStatement)
        {
            //Variables
            ISolverStatement finalStatement = null;
            Term term = ((Z3Statement)innerStatement).Term;

            //
            finalStatement = new Z3Statement(_context.MkNot(term));
            return finalStatement;
        }
예제 #4
0
        public ISolverStatement MakeImplies(string leftVarID, ISolverStatement rightStatement)
        {
            //Variables
            ISolverStatement finalStatement = null;
            Term leftTerm = _variables[leftVarID].Term;
            Term rightTerm = ((Z3Statement)rightStatement).Term;

            //
            finalStatement = new Z3Statement(_context.MkImplies(leftTerm, rightTerm));
            return finalStatement;
        }
예제 #5
0
        public ISolverStatement MakeExcludes(string leftVarID, string rightVarID)
        {
            //Variables
            ISolverStatement finalStatement = null;
            Term leftTerm = _variables[leftVarID].Term;
            Term rightTerm = _variables[rightVarID].Term;

            //
            finalStatement = new Z3Statement(_context.MkNot(_context.MkAnd(leftTerm, rightTerm)));
            return finalStatement;
        }
예제 #6
0
        public ISolverStatement MakeExcludes(ISolverStatement leftStatement, ISolverStatement rightStatement)
        {
            //Variables
            ISolverStatement finalStatement = null;
            Term leftTerm = ((Z3Statement)leftStatement).Term;
            Term rightTerm = ((Z3Statement)rightStatement).Term;

            //
            finalStatement = new Z3Statement(_context.MkNot(_context.MkAnd(leftTerm, rightTerm)));
            return finalStatement;
        }
예제 #7
0
        public ISolverStatement MakeEquivalence(string leftVarID, ISolverStatement rightStatement)
        {
            //Variables
            ISolverStatement finalStatement = null;
            Term leftTerm = _variables[leftVarID].Term;
            Term rightTerm = ((Z3Statement)rightStatement).Term;

            //
            Z3Statement substatement1 = new Z3Statement(_context.MkImplies(leftTerm, rightTerm));
            Z3Statement substatement2 = new Z3Statement(_context.MkImplies(rightTerm, leftTerm));
            finalStatement = new Z3Statement(_context.MkAnd(substatement1.Term, substatement2.Term));
            return finalStatement;
        }
예제 #8
0
        public ISolverStatement MakeAdd(ISolverStatement[] innerStatements)
        {
            //Variables
            ISolverStatement finalStatement = null;
            List<Term> terms = new List<Term>();
            foreach (ISolverStatement innerStatement in innerStatements)
            {
                terms.Add(((Z3Statement)innerStatement).Term);
            }

            //
            finalStatement = new Z3Statement(_context.MkAdd(terms.ToArray()));
            return finalStatement;
        }