/// <summary> /// Visits the specified block. /// </summary> /// <param name="block">The block.</param> public override void Visit(IBlockStatement block) { if (this.insertAssumeFalseAtLine != null) { uint startLine; uint endLine; GetLocationLineSpan(GetPrimarySourceLocationFrom(block.Locations), out startLine, out endLine); if (startLine <= this.insertAssumeFalseAtLine.Value && this.insertAssumeFalseAtLine.Value < endLine) { foreach (IStatement stmt in block.Statements) { GetLocationLineSpan(GetPrimarySourceLocationFrom(stmt.Locations), out startLine, out endLine); GetPrimarySourceLocationFrom(stmt.Locations); if (this.insertAssumeFalseAtLine.Value < endLine) { AssumeStatement assumeFalse = new AssumeStatement(); CompileTimeConstant constFalse = new CompileTimeConstant(); constFalse.Value = false; assumeFalse.Condition = constFalse; this.GetOrCreateStmtListForStmt(stmt).Add(assumeFalse); break; } } } } base.Visit(block); }
/// <summary> /// Visits the specified assume statement. /// </summary> /// <param name="assumeStatement">The assume statement.</param> /// <returns></returns> protected virtual IStatement DeepCopy(AssumeStatement assumeStatement) { assumeStatement.Condition = this.Substitute(assumeStatement.Condition); return assumeStatement; }
/// <summary> /// Visits the specified assume statement. /// </summary> /// <param name="assumeStatement">The assume statement.</param> public override void Visit(IAssumeStatement assumeStatement) { AssumeStatement mutableAssumeStatement = new AssumeStatement(assumeStatement); this.resultStatement = this.myCodeCopier.DeepCopy(mutableAssumeStatement); }
/// <summary> /// Rewrites the children of the given assume statement. /// </summary> /// <param name="assumeStatement"></param> public virtual void RewriteChildren(AssumeStatement assumeStatement) { this.RewriteChildren((Statement)assumeStatement); assumeStatement.Condition = this.Rewrite(assumeStatement.Condition); if (assumeStatement.Description != null) assumeStatement.Description = this.Rewrite(assumeStatement.Description); }
/// <summary> /// Visits the specified assume statement. /// </summary> /// <param name="assumeStatement">The assume statement.</param> public override void Visit(IAssumeStatement assumeStatement) { AssumeStatement mutableAssumeStatement = assumeStatement as AssumeStatement; if (alwaysMakeACopy || mutableAssumeStatement == null) mutableAssumeStatement = new AssumeStatement(assumeStatement); this.resultStatement = this.myCodeMutator.Visit(mutableAssumeStatement); }
/// <summary> /// Visits the specified assume statement. /// </summary> /// <param name="assumeStatement">The assume statement.</param> /// <returns></returns> public virtual IStatement Visit(AssumeStatement assumeStatement) { assumeStatement.Condition = this.Visit(assumeStatement.Condition); return assumeStatement; }