Skip to Content.
Sympa Menu

k-user - [K-user] Using Float literals inside rules

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] Using Float literals inside rules


Chronological Thread 
  • From: Charles Jacobsen <charlie.jacobsen AT utah.edu>
  • To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: [K-user] Using Float literals inside rules
  • Date: Wed, 19 Jun 2013 19:24:07 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Hello again,

This may be a bug, but I am not sure:

module TEST

   syntax Expr ::= "1.0 + 2.0"

   rule 1.0 + 2.0 => 1.0 +Float 2.0  [structural]

endmodule

leads to a "parsing ambiguity" error, while

module TEST

   syntax Expr ::= "1 + 2"

   rule 1 + 2 => 1 +Int 2  [structural]

endmodule

does not (and produces 3 when given the program "1+2"). I suspect it's because '.' has special meaning inside k rules. Parsing ambiguity does not result when a Float literal is used inside of the "where" clause of a k rule.


  • [K-user] Using Float literals inside rules, Charles Jacobsen, 06/19/2013

Archive powered by MHonArc 2.6.16.

Top of Page