k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Omar Duhaiby <3omarz AT gmail.com>
- To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
- Cc: "Musab A. AlTurki" <musab AT kfupm.edu.sa>
- Subject: Re: [K-user] multiple fresh Ints in one rule
- Date: Sat, 8 Nov 2014 16:24:23 +0300
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Thanks for the workaround. But I think I did something better. I didn't split the rule into two. I just replaced the contents of the K cell of the second thread with a special function that I defined:
syntax K ::= getNewId(K) [function]
rule
<k> getNewId(E) => E </k>
<tid> _ => !NewId:Int </tid>
[structural]
syntax K ::= getNewId(K) [function]
rule
<k> getNewId(E) => E </k>
<tid> _ => !NewId:Int </tid>
[structural]
On Fri, Nov 7, 2014 at 9:41 PM, Andrei Stefanescu <andreistef AT gmail.com> wrote:
Omar, this is a bug. Thank you for reporting it. I'm looking into it now.AndreiOn Fri, Nov 7, 2014 at 12:24 PM, Moore, Brandon Michael <bmmoore AT illinois.edu> wrote:_______________________________________________That looks like a bug, but you can probably work around it with an extra step if you need to.
Something like:
rule <k> iWantChildren => iWantSecondChild ...</k>
(. => <thread> <tid> !NewId1:Int </tid> </thread>)
rule <k> iWantSecondChild => . ...</k>
(. => <thread> <tid> !NewId2:Int </tid> </thread>)
that does take a second step, maybe opens up unwanted interleavings, etc.,
but hopefully it will get your definition going again.
Brandon
From: k-user-bounces AT cs.uiuc.edu [k-user-bounces AT cs.uiuc.edu] on behalf of Omar Duhaiby [3omarz AT gmail.com]
Sent: Thursday, November 06, 2014 3:55 AM
To: k-user AT cs.uiuc.edu
Cc: Traian Șerbănuță; Musab A. AlTurki; Dwight Guth
Subject: [K-user] multiple fresh Ints in one rule
Omar AlzuhaibiThank youthis makes two threads with the same value. How should I do it?(. => <thread> <tid> !NewId1:Int </tid> </thread>I didn't have a problem in the older version using the fresh function, but now using '!' like the following example gives the same value twice:rule <k> iWantChildren </k>
<thread> <tid> !NewId2:Int </tid> </thread>
)
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- [K-user] multiple fresh Ints in one rule, Omar Duhaiby, 11/06/2014
- Re: [K-user] multiple fresh Ints in one rule, Omar Duhaiby, 11/07/2014
- Re: [K-user] multiple fresh Ints in one rule, Rosu, Grigore, 11/07/2014
- Re: [K-user] multiple fresh Ints in one rule, Moore, Brandon Michael, 11/07/2014
- Re: [K-user] multiple fresh Ints in one rule, Andrei Stefanescu, 11/07/2014
- Re: [K-user] multiple fresh Ints in one rule, Omar Duhaiby, 11/08/2014
- Re: [K-user] multiple fresh Ints in one rule, Andrei Stefanescu, 11/07/2014
- Re: [K-user] multiple fresh Ints in one rule, Omar Duhaiby, 11/07/2014
Archive powered by MHonArc 2.6.16.