k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Omar Duhaiby <3omarz AT gmail.com>
- To: k-user AT cs.uiuc.edu
- Subject: [K-user] Type List in configuration cell
- Date: Fri, 28 Mar 2014 13:32:26 -0500
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hello,
I'm trying to do the following
syntax Val ::= Int
syntax Vals ::= List{Val,","} [strict]
syntax KResult ::= Val | Vals
syntax Vals ::= List{Val,","} [strict]
syntax KResult ::= Val | Vals
configuration
<T>
<k> $PGM:Vals </k>
<return> $RET:KResult </return>
</T>
<T>
<k> $PGM:Vals </k>
<return> $RET:KResult </return>
</T>
rule <k> V:Val => . ...</k> <return>... . => ListItem(V) </return> [structural]
I get this
I get this
[Error] Critical: Wrong type in cell 'return'. Expected sort: K but found List
I have three questions:
1. Can I define a type for a config cell without having to put a config variable that I don't need like I did with $RET?
2. How do I append a value to the list?
3. How do I concatenate two lists?
Thank you
- [K-user] Type List in configuration cell, Omar Duhaiby, 03/28/2014
Archive powered by MHonArc 2.6.16.