runtimeverification / runtimeverification/wasm-semantics
Make functions in `numeric.md` total `functional`
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 106
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
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, andtruncFloatneed to be made total. rule FTYPE . sqrt => ...needs to either have (i)sqrtFloatbe madefunctionalindomains.k, or (ii) explicitely handle the cases thatsqrtFloatdoes not.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in numeric.md, reviewing the listed operator definitions and helper functions such as #minWidth, #ctz, #popcnt, #round, #signed, #unsigned, #isInfinityOrNan, and truncFloat. Then inspect domains.k for sqrtFloat and determine whether it can be made functional or whether sqrt's unsupported cases need explicit handling; done means the operators no longer generate #Ceil side conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100