This proof needs cleanup, and is stacked over the theory developed over at #4179 .
The key idea is to notice that signExtend behavior is controlled by the msb. When msb = false, sext behaves the same as trunc. When msb = true, sext behaves like trunc but adds high 1-bits. This is expressed using the negate-truncate-negate pattern. Lemma statements below:
This proof needs cleanup, and is stacked over the theory developed over at #4179 . The key idea is to notice that
signExtend
behavior is controlled by themsb
. Whenmsb = false
,sext
behaves the same astrunc
. Whenmsb = true
,sext
behaves liketrunc
but adds high 1-bits. This is expressed using the negate-truncate-negate pattern. Lemma statements below:These give the final theorem statement: