Skip to Content.
Sympa Menu

k-user - [K-user] MInt overflowMInt and miMInt functions

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] MInt overflowMInt and miMInt functions


Chronological Thread 
  • 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.

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

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:


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




Archive powered by MHonArc 2.6.16.

Top of Page