//^^ ensures result.GetType() == this.GetType(); //^^ ensures result.ContainingBlock == containingBlock; /// <summary> /// Makes a copy of this expression, changing the ContainingBlock to the given block. /// </summary> //^ [MustOverride] public override Expression MakeCopyFor(BlockStatement containingBlock) { if (this.ContainingBlock == containingBlock) return this; AdditionAssignment result = new VccAdditionAssignment(containingBlock, this); //^ assume result.ContainingBlock == containingBlock; //This should be a post condition of the constructor, but such post conditions are not currently permitted by the methodology. return result; }
//^ requires template.ContainingBlock != containingBlock; //^ ensures this.containingBlock == containingBlock; /// <summary> /// A copy constructor that allocates an instance that is the same as the given template, except for its containing block. /// </summary> /// <param name="containingBlock">A new value for containing block. This replaces template.ContainingBlock in the resulting copy of template.</param> /// <param name="template">The template to copy.</param> protected VccAdditionAssignment(BlockStatement containingBlock, VccAdditionAssignment template) : base(containingBlock, template) { }