k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Frederico Zica <fredzica AT gmail.com>
- To: k-user AT cs.uiuc.edu
- Subject: [K-user] MInt overflowMInt and miMInt functions
- Date: Thu, 31 Jul 2014 02:13:20 +0200
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hello.
But when I run then they don't reduce (part of krun output):
<rc> overflowMInt ( ListItem(mi ( 8 , 300 )) ListItem(true) ) </rc>
However, if I remove from the rules the explicit mention of the MInt type, both functions start working:
The operation I used was the uaddMInt.
Am I doing something wrong? Is that a bug in MInt the builtin?
Thanks,Frederico Zica
I'm using the K Framework for some time now. Also in my project I'm using the MInt builtin, because I need to represent 8-bit wide numbers.
Initially I was using the stable version. From some point on, as I realized the stable was not so recent already, I decided to use the nightly build. The MInt type source files changed and I refactored the code according to those changes. The problem I have with is with the functions overflowMInt and miMInt. They are supposed to only take the overflow and MInt values, as seem in the mint.k builtin:
rule miMInt(MyListItem(MI:MInt), MyListItem(_:Bool)) => MI
rule overflowMInt(MyListItem(_:MInt), MyListItem(B:Bool)) => B
<rc> overflowMInt ( ListItem(mi ( 8 , 300 )) ListItem(true) ) </rc>
However, if I remove from the rules the explicit mention of the MInt type, both functions start working:
rule miMInt(MyListItem(mi(N, I)), MyListItem(_:Bool)) => mi(N, I) rule overflowMInt(MyListItem(_), MyListItem(B:Bool)) => B
The operation I used was the uaddMInt.
Am I doing something wrong? Is that a bug in MInt the builtin?
Thanks,Frederico Zica
- [K-user] MInt overflowMInt and miMInt functions, Frederico Zica, 07/30/2014
- Re: [K-user] MInt overflowMInt and miMInt functions, Dwight Guth, 07/31/2014
Archive powered by MHonArc 2.6.16.