Dafny Context Changes Proposal Error

It is very difficult for me to get rid of the last error in my Dafny program. Can someone point me in the right direction? Here is the code: http://rise4fun.com/Dafny/2FPo

I get this error: assignment can update an array element that is not in the context context, modifies the sentence

I tried to add a rectangle modification in the merge method (although I'm sure it is already included in the modification of this), but it just creates a similar error when the merge method is called.

I really lost it. thanks for the help

+4
source share
1 answer

The problem is that “modifies this” allows you to modify fields , , . , , :

this.rectangles := new_rectangle_array;

:

this.rectangles[3] := new_rect;

, , " ", " ".

Test " c.rectangles", " c".

, Dafny , Test Couverture, - . , Test: , couv , Main .

http://rise4fun.com/Dafny/Skrg.

+5
source

Source: https://habr.com/ru/post/1675540/


All Articles