Demonstrates the use of uninterpreted functions for the purposes of code generation. This facility is important when we want to take advantage of native libraries in the target platform, or when we'd like to hand-generate code for certain functions for various purposes, such as efficiency, or reliability.
A definition of shiftLeft that can deal with variable length shifts.
(Note that the `
shiftL` method from the
Bits class requires an
amount.) Unfortunately, this'll generate rather clumsy C code due to the
use of tables etc., so we uninterpret it for code generation purposes
Test function that uses shiftLeft defined above. When used as a normal Haskell function or in verification the definition is fully used, i.e., no uninterpretation happens. To wit, we have:
tstShiftLeft 3 4 5224 :: SWord32
prove $ \x y -> tstShiftLeft x y 0 .== x + yQ.E.D.