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...
```
``` 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...
```