Re: [prism] Module renaming and local variables

6 views
Skip to first unread message

Dave Parker

unread,
Mar 31, 2022, 2:09:25 PMMar 31
to prismmod...@googlegroups.com, Mridu Nanda
Hi Mridu,

Yes, initialise the variable to a named constant (declared as "const int
myvar1_init = 0;"). Then you can rename this constant myvar1_init as
part of your module renaming.

Best wishes,

Dave

On 09/03/2022 02:08, Mridu Nanda wrote:
> The module renaming feature is great because it avoids code duplication.
> However, is there a way to reinitialize local variables in the module
> renaming?
>
> For example, say I have a module that looks like:
>
> module mod1
>     myvar1 : [0..2] init 0;
> endmodule
>
> Then if create module 2 via module renaming as so:
>
> module mod2 = mod1 [myvar1=myvar2]
>
> Is there a way to initialize myvar2=1? Currently, myvar2 will be
> initialized to 0, because that is what myvar1 was initialized as.
>
> Thank you,
> Mridu
>
> --
> You received this message because you are subscribed to the Google
> Groups "PRISM model checker" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to prismmodelchec...@googlegroups.com
> <mailto:prismmodelchec...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/prismmodelchecker/2301963e-a101-4a14-88ac-fe6d78fb77f2n%40googlegroups.com
> <https://groups.google.com/d/msgid/prismmodelchecker/2301963e-a101-4a14-88ac-fe6d78fb77f2n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages