Example #1
0
        private int NumOfCommands(VCHint hint)
        {
            if (hint is AssumeConjHint assumeConjHint)
            {
                return(assumeConjHint.NumCommands);
            }

            throw new ProofGenUnexpectedStateException(GetType(), "unexpected hint");
        }
Example #2
0
        public void AddHint(Cmd cmd, VCHint hint)
        {
            if (nextCmd < 0 || cmd != cmds[nextCmd])
            {
                throw new ProofGenUnexpectedStateException(GetType(), "current hint database does not match cmd");
            }

            _hints[nextCmd] = hint;

            nextCmd--;
        }
Example #3
0
        /// <summary>
        ///     check whether assumeCmd is special with respect to VC and if so, store hint in out parameter, otherwise
        ///     store null in <paramref name="hint" />
        /// </summary>
        /// <returns>true, if is a special case <paramref name="hint" />, false otherwise</returns>
        private bool IsSpecialAssumeStmt(AssumeCmd assumeCmd, VCExpr exprVC, VCExpr postVC, out VCHint hint)
        {
            if (exprVC.Equals(VCExpressionGenerator.False))
            {
                hint = new AssumeSimpleHint(AssumeSimpleHint.AssumeSimpleType.ASSUME_FALSE);
                return(true);
            }

            if (postVC.Equals(VCExpressionGenerator.False))
            {
                hint = new AssumeSimpleHint(AssumeSimpleHint.AssumeSimpleType.ASSUME_NOT);
                return(true);
            }

            if (exprVC.Equals(VCExpressionGenerator.True) || postVC.Equals(VCExpressionGenerator.True))
            {
                hint = new AssumeSimpleHint(AssumeSimpleHint.AssumeSimpleType.ASSUME_TRUE);
                return(true);
            }

            hint = null;
            return(false);
        }