Comments (4)
Hi Matt,
Is this expected? In my thinking, x is a record instance. But Uclid5 does not seem to enjoy its field having the same name.
Let's say I don't think this is deliberate but I am not surprised.. can you work around by having different names and I'll look into it. At the very least we should throw a more meaningful error.
arr[0].a = 10;
Yes, we currently don't parse this, it's on my list of things to add. It's a bit laborious, especially with a big record type, but instead you can write:
arr[0] = {10, arr[0].b};
Thanks for the minimal bug reports!
from uclid.
Hi Elizabeth, thanks for the speedy reply!
Renaming the field might be a little complicated, as I'm translating user input so they're free to write whatever's legal in the source language (Murphi). I might have to just detect and reject input like this.
Thanks for the record work around. I think this is achievable, but I have to think more deeply about it. Murphi unfortunately allows arbitrary nesting here so a naive translation might produce things like a[0].b.c[2].d[3]
.
from uclid.
Ok, I'll aim to have a look at both the issues next week and let you know
from uclid.
I realized the work around for array assignment actually won't work for my use case. Coming from Murphi, the index can be a variable. E.g. the originating Murphi code might look like:
procedure foo(var r: complex_type_t; var i: 0..10); begin
r[i].a := 10;
end;
I can't think of a way to translate this to Uclid5 other than some kind of 11-alternative if-then-else branch on the value of i
. Obviously this also causes complications if i
is not just a variable but a more complex expression like a call to an impure function. E.g. r[my_func()].a := 10
.
Because this is all related to generated code from artificial test cases, I think you should probably ignore this issue for now. Maybe something to revisit if another user has a real world model that hits this problem.
from uclid.
Related Issues (20)
- z3 java bindings on Mac
- bitwise operations on integers cause uncaught exceptions HOT 1
- replace genericProofCommand
- TODO: macros
- TODO: document finite_foralls HOT 1
- LTL bug
- The counterexample of induction with k > 1 shows one less state in the induction_step. HOT 1
- using past and history function in invariants HOT 3
- synthesis test 7
- synthesis test 7
- Enum variants in modules not recognized without importing type in main module HOT 1
- Record literals not type-checking properly
- instance procedure calls use modified values HOT 1
- Z3 array not converted to string in counterexample HOT 2
- Variables sometimes fail to update in counterexamples HOT 3
- Assertions on values of variables changed by child modules in `next` block have inconsistent values
- tutorial/ex4.4 embeded assertions not working as expected HOT 2
- Assumption on array causes malfunctioning checks HOT 5
- The `bmc` command currently ignores `assert` statements. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uclid.