k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Dwight Guth <dwight.guth AT runtimeverification.com>
- To: Omar Duhaiby <3omarz AT gmail.com>
- Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
- Subject: Re: [K-user] count cells
- Date: Wed, 12 Nov 2014 10:37:41 -0600
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
The recommended way to do this is to create a function that takes a bag of Cells and returns how many copies of that cell are in the bag. Then, you create a rule similar to the following:
rule <threads> C:Bag </threads> <someOtherCell> countThreads(C) </someOtherCell>On Tue, Nov 11, 2014 at 3:12 PM, Omar Duhaiby <3omarz AT gmail.com> wrote:
Hello,
Can I get a count of the number of instances of a certain cell type? For example, I want to count the number of threads in the environment.
I could keep a count of course by incrementing it every time I create a thread, and decrementing every time I destroy one, but I'm asking if such a feature is available in K.
Thank you
Omar Alzuhaibi
_______________________________________________
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- [K-user] count cells, Omar Duhaiby, 11/11/2014
- Re: [K-user] count cells, Dwight Guth, 11/12/2014
- Re: [K-user] count cells, Omar Duhaiby, 11/12/2014
- Re: [K-user] count cells, Dwight Guth, 11/12/2014
- Re: [K-user] count cells, Omar Duhaiby, 11/14/2014
- Re: [K-user] count cells, Dwight Guth, 11/12/2014
- Re: [K-user] count cells, Omar Duhaiby, 11/12/2014
- Re: [K-user] count cells, Dwight Guth, 11/12/2014
Archive powered by MHonArc 2.6.16.