{"action":"created","issue":{"url":"https://api.github.com/repos/kframework/k/issues/1836","labels_url":"https://api.github.com/repos/kframework/k/issues/1836/labels{/name}","comments_url":"https://api.github.com/repos/kframework/k/issues/1836/comments","events_url":"https://api.github.com/repos/kframework/k/issues/1836/events","html_url":"https://github.com/kframework/k/issues/1836","id":116372582,"number":1836,"title":"Builtin counters of instances of cell types","user":{"login":"omarz1","id":7592333,"avatar_url":"https://avatars.githubusercontent.com/u/7592333?v=3","gravatar_id":"","url":"https://api.github.com/users/omarz1","html_url":"https://github.com/omarz1","followers_url":"https://api.github.com/users/omarz1/followers","following_url":"https://api.github.com/users/omarz1/following{/other_user}","gists_url":"https://api.github.com/users/omarz1/gists{/gist_id}","starred_url":"https://api.github.com/users/omarz1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omarz1/subscriptions","organizations_url":"https://api.github.com/users/omarz1/orgs","repos_url":"https://api.github.com/users/omarz1/repos","events_url":"https://api.github.com/users/omarz1/events{/privacy}","received_events_url":"https://api.github.com/users/omarz1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-11T16:39:07Z","updated_at":"2015-11-11T17:44:29Z","closed_at":null,"body":"Hello,\r\n\r\nCan we implement a builtin counter for threads? that is to provide a count of the number of threads in the environment. In general, we should be able to count instances of any type of cell. This will give more power to the conditions of a rule. For instance, this will allow us to say \"If ALL threads in the environment are so and so...\"\r\n\r\nI suggested a builtin counter before for transitions here (#1385)."},"comment":{"url":"https://api.github.com/repos/kframework/k/issues/comments/155858543","html_url":"https://github.com/kframework/k/issues/1836#issuecomment-155858543","issue_url":"https://api.github.com/repos/kframework/k/issues/1836","id":155858543,"user":{"login":"dwightguth","id":5104541,"avatar_url":"https://avatars.githubusercontent.com/u/5104541?v=3","gravatar_id":"","url":"https://api.github.com/users/dwightguth","html_url":"https://github.com/dwightguth","followers_url":"https://api.github.com/users/dwightguth/followers","following_url":"https://api.github.com/users/dwightguth/following{/other_user}","gists_url":"https://api.github.com/users/dwightguth/gists{/gist_id}","starred_url":"https://api.github.com/users/dwightguth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwightguth/subscriptions","organizations_url":"https://api.github.com/users/dwightguth/orgs","repos_url":"https://api.github.com/users/dwightguth/repos","events_url":"https://api.github.com/users/dwightguth/events{/privacy}","received_events_url":"https://api.github.com/users/dwightguth/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T17:44:29Z","updated_at":"2015-11-11T17:44:29Z","body":"This should be doable I think... You can use the `#configuration` function to get the complete configuration from inside a function, and then you can traverse the configuration until you get to the cell you care about and iterate through all the elements in the collection summing up the count. I suspect we will not provide builtin support for this using a hook, however."}}