Closed bts closed 5 years ago
Possibly! Would be great to play around with these a bit and see what sort of extra functionality needed. An actual use-case would be good too if you can contribute that as an example file that we can ship with SBV.
@bts
The following works just fine
Prelude Data.SBV Data.SBV.Either> prove $ \x y z -> ite x y (z::SEither Bool Integer) .== z
Falsifiable. Counter-example:
s0 = True :: Bool
s1 = Left False :: Either Bool Integer
s2 = Right 0 :: Either Bool Integer
This works because of the default SBV instance for mergeable: Note that if a type directly maps to an SMTLib type, then we get mergeable for free: SMTLib does it for us!
Is this what you were worried about? Is there some other scenario that might go wrong?
Ah perfect! Yeah, the instance SymVal a => Mergeable (SBV a)
does the trick for us. That makes sense. Thanks!
Hi Levent,
It seems that just as
ite
, the symbolic eliminator for theBool
sum type,symbolicMerge
s amongst its possible outcomes, that we should probably similarly have aMergeable
constraint on the symbolic eliminatoreither
? (Disclaimer: I have not yet played with the this newEither
functionality firsthand -- I may be failing to take something into account.)Thoughts? Brian