-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split up Arith? #686
Comments
I can confirm that the division operation on In that same code, we needed to do exponentiation with a different exponent type than base type. So, while it didn't necessarily have to be And, yes, I agree that many of these operations don't make sense for floats and reals. |
I agree that type of the exponentiation operator |
I also think that |
Agreed. I even thought we removed |
We removed |
As for enumeration operators: The weirdness in Haskell's list enumerations on floats has to do with deciding when to cut off at the end; we won't have that problem here, as all the There is one bit of weirdness we'll have to deal with for float enumerations in Cryptol: For |
Ah yes, got confused. I don't know that I've ever used the value level |
A quick search through the I don't expect I would ever need to use value-level |
I am not sure that we need to support enumerations on floats, and we probably should have a separate class for them. Half-baked idea: we've also talked about adding a class to generalize indexing, and I wonder if the |
OK, here's a straw proposal (names subject to bike-shedding, obviously):
We may also want another class for field (and field-like) division, which will contain reals, floats and For backwards-compatibility, perhaps make |
I like most of @robdockins's proposal, except that I would prefer not to give On bitvector types, |
Closed via #724 |
While working on some simulator internals, it occurs to me that we should maybe think about reorganizing the
Arith
class. CurrentlyArith
contains the following operations:These were are all sensible operations when Cryptol basically only contained bitvectors as primitive types. However, with the addition of
Z
and (especially)Z_n
types and the planned addition of floating point and real types, it's really unclear that this grouping still makes sense.Problems worth discussing:
Z_n
don't make much sense, as those types naturally only have the structure of a ring. Moreover, even whenn
is a prime, I'm pretty sure the division we offer doesn't match the multiplicative inverse structure of the prime field.a -> [n] -> a
) rather than, say, theexp
operator on real numbers.lg2
is probably too general, and maybe doesn't make much sense at some types (againZ_n
is a little strange here, and floating point types will be odd as well).The text was updated successfully, but these errors were encountered: