Skip to Content.
Sympa Menu

k-user - [K-user] Check "global" cell property and re-write

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] Check "global" cell property and re-write


Chronological Thread 
  • From: Charles Jacobsen <charlie.jacobsen AT utah.edu>
  • To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: [K-user] Check "global" cell property and re-write
  • Date: Mon, 10 Jun 2013 20:49:27 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Suppose, for example, that a rule re-writes a cell <x> that is a bag containing heavily nested cells (e.g., the <agents> cell in the CHALLENGE language in the overview). Suppose one would like to re-write some cell within <x> under the condition that <x> satisfies a certain property that cannot be expressed as a simple pattern. Is there a nice way to do this without using auxiliary cells to track the property?

For example, suppose a maximum of 300 threads are allowed, globally across all agents, in the CHALLENGE language. One could keep a global thread count, but would it be possible to do something like:

<agents> A:Bag => ? </agents>
where numThreads(A) <Int 301

but how to fill in ? now that we've abstracted the inner structure of <agents>? Is there a way one could refer to the entire cell, but still maintain some of its structure?

This question is more out of curiosity.

Thanks,

Charlie



Archive powered by MHonArc 2.6.16.

Top of Page