Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliasing problem with indices #114

Open
MattWindsor91 opened this issue Dec 1, 2016 · 2 comments
Open

Aliasing problem with indices #114

MattWindsor91 opened this issue Dec 1, 2016 · 2 comments

Comments

@MattWindsor91
Copy link
Collaborator

In the microcode translations of individual commands, the semantics of the resulting list of microcode instructions is that they are under disjoint parallel composition. This means that each assignment in that single command assigns the same MarkedVar level to the same MarkedVar level. For example,

[ Assign x 3; Assign y z ]

would translate into

(x!after == 3 && y!after == z!before && frame)

This is perfectly sound for variables, as disjointness is guaranteed lexically. However, translating

[ Assign a[x] 3; Assign a[y] z ]

to

(a!after = (a!before with [x] == 3) && a!after == (a!before with [y] == z) && frame)

is wrong, and

(a!after = ((a!before with [x] == 3) with [y] == z)) && frame)

has unsound, or at least unclear, semantics when x == y.

I think what I'll need to do is change the semantics here to sequential composition, so each separate microcode operation generates a new intermediate stage. This, however, is fairly nontrivial when it comes to branches.

Failing this, we could disallow use of the same array multiple times in a command. In fact, I think this is technically done right now, since our current command set doesn't allow multiple assignments to the same environment in one command.

MattWindsor91 added a commit that referenced this issue Dec 1, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
@bensimner
Copy link
Collaborator

Why not the obviously-correct semantics of

[ Assign a[x] i; Assign a[y] j ] -> (a!after[x] == i) && (a!after[y] == j) && (k not i or j => a!after[k] = a!before[k]) && frame

@MattWindsor91
Copy link
Collaborator Author

@bensimner inefficiency, I think

MattWindsor91 added a commit that referenced this issue Dec 2, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Dec 5, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Dec 6, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Dec 7, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Dec 12, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Dec 12, 2016
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Jan 30, 2017
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
MattWindsor91 added a commit that referenced this issue Jan 30, 2017
This implements havoc by making assignment targets optional.

Also fixed a typo in the array normalisation.  See #114 for the
remaining array problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants