Skip to content

Make functions in numeric.md total functional #317

Open
@ehildenb

Description

@ehildenb

Right now there are #Ceil side-condition generated by the backend for the operators defined in numeric.md:

    syntax Val ::= IValType "." IUnOp Int   [klabel(intUnOp)  , function] 
                 | FValType "." FUnOp Float [klabel(floatUnOp), function] 
 // --------------------------------------------------------------------- 
    syntax Val ::= IValType "." IBinOp Int   Int   [klabel(intBinOp)  , function] 
                 | FValType "." FBinOp Float Float [klabel(floatBinOp), function] 
 // ----------------------------------------------------------------------------- 
    syntax Val ::= IValType "." TestOp Int [klabel(intTestOp), function] 
 // -------------------------------------------------------------------- 
    syntax Val ::= IValType "." IRelOp Int   Int   [klabel(intRelOp)  , function] 
                 | FValType "." FRelOp Float Float [klabel(floatRelOp), function] 
 // ----------------------------------------------------------------------------- 
    syntax Val ::= AValType "." CvtOp Number [klabel(numberCvtOp), function] 
 // ------------------------------------------------------------------------ 

I'm pretty sure these all can be made functional, with the appropriate changes to the helper functions they use.

For example:

  • The functions #minWidth, #ctz, #popcnt, #round, #signed, #unsigned, #isInfinityOrNan, and truncFloat need to be made total.
  • rule FTYPE . sqrt => ... needs to either have (i) sqrtFloat be made functional in domains.k, or (ii) explicitely handle the cases that sqrtFloat does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions