Skip to Content.
Sympa Menu

k-user - Re: [K-user] How does <k> rules work?

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] How does <k> rules work?


Chronological Thread 
  • From: Traian Florin Șerbănuță <traian.serbanuta AT info.uaic.ro>
  • To: Ömer Sinan Ağacan <omeragacan AT gmail.com>
  • Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: Re: [K-user] How does <k> rules work?
  • Date: Mon, 19 Aug 2013 22:30:26 +0300
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

If you want to wrap it with the <k> cell you should probably leave the <k> cell open to the right, by adding ... at the end of the cell, e.g., 
<k> concatToConcat1(.Concat) => . ...</k>

The difference with the new rule is that it allows other things to exist in the computation cell, which are subsumed by the ellipses.

best wishes,
Traian


2013/8/19 Ömer Sinan Ağacan <omeragacan AT gmail.com>
Hi all,

I have a K program with a rule like this:

    rule concatToConcat1(.Concat) => .
    rule concatToConcat1(C Cs) => C ~> concatToConcat1(Cs)

This works fine and it can only be applied to <k> configuration,
because in my program it's guaranteed that `concatToConcat1` can only
be placed in <k> (actually it's not guaranteed statically in the sense
that type safety is guaranteed statically by type systems, and I'm not
sure if such a thing is even possible, it's just guaranteed by other
rules, which never place this syntax in a place other than <k>).

But for some reason if I wrap this rule with <k> ... </k>, it no more works:

    rule <k> concatToConcat1(.Concat) => . </k>
    rule <k> concatToConcat1(C Cs) => C ~> concatToConcat1(Cs) </k>

Why is that?

(I'm not pasting my program because it's kinda big, but if required I
can paste K program and some simple input for demonstration)

Thanks,

---
Ömer Sinan Ağacan
http://osa1.net

_______________________________________________
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