k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Dwight Guth <dwight.guth AT gmail.com>
- To: Omar Duhaiby <3omarz AT gmail.com>
- Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>, "Musab A. AlTurki" <musab AT kfupm.edu.sa>
- Subject: Re: [K-user] count cells
- Date: Wed, 12 Nov 2014 14:56:53 -0600
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
The mechanism that we generally recommend is to wrap multiplicity-* collections inside a wrapper cell. So for example instead of:
configuration <thread multiplicity="*"> <k> ...you have an additional layer:
On Wed, Nov 12, 2014 at 2:42 PM, Omar Duhaiby <3omarz AT gmail.com> wrote:
Thank you, that's useful. But then I can't count threads that for example enclose a <k> . </k>, Can I?
On Nov 12, 2014 7:37 PM, "Dwight Guth" <dwight.guth AT runtimeverification.com> wrote: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.