Skip to Content.
Sympa Menu

maude-help - [[Maude-help] ] Matching negative Floats

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

[[Maude-help] ] Matching negative Floats


Chronological Thread 
  • From: Marius Storeide <marius AT kikora.no>
  • To: maude-help AT lists.cs.illinois.edu
  • Subject: [[Maude-help] ] Matching negative Floats
  • Date: Tue, 6 Nov 2018 12:32:06 +0100
  • Authentication-results: illinois.edu; spf=none smtp.mailfrom=marius AT kikora.no; dkim=pass header.d=kikora-no.20150623.gappssmtp.com header.s=20150623; dmarc=none

Using the match command, I try to match out negative floating on the command line:

Maude> match -A:Float <=? -4.3 .
match in CONVERSION : -A:Float <=? -4.2999999999999998 .
Decision time: 0ms cpu (0ms real)

Solution 1
-A:Float --> -4.2999999999999998

This does not work, as the '-' is considered part of the label. I encounter the same problem when attempting the same in a module. This is intended as a minimum example of such a case, it is not what I actually intend to do with the floating-point number. Put another way: I can not solve my problem with "abs(...)".

fmod TEST is
    pr CONVERSION .

    eq [Absolute-number] :
        -A:Float =
        A:Float .
endfm

Maude> in experiment.maude
==========================================
fmod TEST
Warning: "experiment.maude", line 4 (fmod TEST): variable A:Float is used before it is bound in equation:
eq -A:Float = A:Float [label Absolute-number] .

If I add a space between the '-' and 'A' (or any other label I give it), the match fails, which means I'm no closer to my goal:

Maude> match - A:Float <=? -4.3 .
match in CONVERSION : - A:Float <=? -4.2999999999999998 .
Decision time: 0ms cpu (0ms real)
No match.

Is there any way to make this work, i.e. match out negative Floats?

sincerely,
Marius Storeide Kjelsvik



Archive powered by MHonArc 2.6.19.

Top of Page