Closed niedjoh closed 3 months ago
It certainly is! You may drop a PR if you want. Otherwise i will add it very soon. This may actually decrease formula size by quite a lot in some use cases. Thank you!
Any specific reason why not for Real and BitVec? I will add them otherwise and publish to hackage.
no specific reason - these are just the cases which I need at the moment ^^ It also just occured to me that I forgot to add proper constant folding for the Num instance, e.g.
(Constant (IntValue x)) + (Constant (IntValue y)) = Constant (IntValue (x + y))
and also for the other functions. thanks for your quick reply!
Has been published with v2.3.1
It would be convenient to have smart constructors for things like (&&) and (+) which directly handle constants. For example, in Language.Hasmtlib.Internal.Expr.Num you could write:
and Language.Hasmtlib.Internal.Expr could look as follows:
I saw that as of version 2.3 the constructors of Expr are exported, so I can now just write wrappers which implement this functionality, but I think it's still a useful enhancement of the library :)