Skip to Content.
Sympa Menu

k-user - Re: [K-user] multiple fresh Ints in one rule

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] multiple fresh Ints in one rule


Chronological Thread 
  • From: "Moore, Brandon Michael" <bmmoore AT illinois.edu>
  • To: Omar Duhaiby <3omarz AT gmail.com>, "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Cc: Traian Șerbănuță <traian.serbanuta AT gmail.com>, "Musab A. AlTurki" <musab AT kfupm.edu.sa>, Dwight Guth <dwight.guth AT gmail.com>
  • Subject: Re: [K-user] multiple fresh Ints in one rule
  • Date: Fri, 7 Nov 2014 18:24:17 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

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

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> !NewId1:Int </tid> </thread>
        <thread> <tid> !NewId2:Int </tid> </thread>
)

this makes two threads with the same value. How should I do it?

Thank you
Omar Alzuhaibi



Archive powered by MHonArc 2.6.16.

Top of Page