Quantcast
Channel: Dafny: An Automatic Program Verifier for Functional Correctness
Viewing all articles
Browse latest Browse all 1106

Created Unassigned: Sets of objects by extension [44]

$
0
0
It would be nice to be able to write a set of objects by extension; a typical use-case would be initializing a dynamic frame, as in:

``` C#
class C {

ghost var rep: set<object>;
var impl: Aux;

constructor create()
modifies this;
{
this.impl := new Aux.init();
this.rep := {this,this.impl};
}
}

class Aux{
constructor init() {
}
}
```
Which fails since `this` and `this.impl` have different types. This works but is rather distracting:

```C#
constructor create()
modifies this;
{
this.impl := new Aux.init();
this.rep := {this};
this.rep := this.rep + {this.impl};
}
}

I couldn't find a better way of expressing it...

```

Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>