Code Monkey home page Code Monkey logo

Comments (4)

polgreen avatar polgreen commented on August 13, 2024

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.

Smattr avatar Smattr commented on August 13, 2024

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.

polgreen avatar polgreen commented on August 13, 2024

Ok, I'll aim to have a look at both the issues next week and let you know

from uclid.

Smattr avatar Smattr commented on August 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.