k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: samira kherfellah <samira.kherfellah AT gmail.com>
- To: k-user AT cs.uiuc.edu
- Subject: [K-user] Variable declaration
- Date: Fri, 30 Aug 2013 17:58:03 +0200
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hi All,
Here is an example of using variables in my language
var i integer ;
...
task i := i+1;
...
The variables must be initialized to 0, the rules are defined as follows:
rule <k> var X:Id TV:Type ; => . ...</k>
<tenv>... . => X |-> TV ...</tenv>
<store>... . => X |-> 0 ...</store>
// lookup
rule <k> X:Id => V ...</k>
<store>... X |-> V ...</store>
rule <k> task X:Id := I:Int ; => . ...</k>
<store>... X |-> (_=> I) ...</store>
<tenv>... X |-> integer ...</tenv>
this way is it correct or there is something else to add? how to initialize variables to 0?
Thanks.
Samira.
- [K-user] Variable declaration, samira kherfellah, 08/30/2013
- Re: [K-user] Variable declaration, Moore, Brandon Michael, 08/30/2013
- Message not available
- Re: [K-user] Variable declaration, Moore, Brandon Michael, 08/30/2013
- Message not available
- Re: [K-user] Variable declaration, Moore, Brandon Michael, 08/30/2013
Archive powered by MHonArc 2.6.16.