Skip to Content.
Sympa Menu

k-user - Re: [K-user] count cells

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] count cells


Chronological Thread 
  • From: Omar Duhaiby <3omarz AT gmail.com>
  • To: Dwight Guth <dwight.guth AT runtimeverification.com>
  • Cc: 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 23:42:39 +0300
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

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





Archive powered by MHonArc 2.6.16.

Top of Page