@@ -223,6 +223,16 @@ case class ACN(base: Codec) {
223223 require(nBits <= encodedSizeInBits && encodedSizeInBits <= 64 )
224224 require(BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, encodedSizeInBits))
225225 enc_Int_PositiveInteger_ConstSize(intVal.toLong.toRawULong, encodedSizeInBits)
226+ }.ensuring { _ =>
227+ val w1 = old(this )
228+ val w3 = this
229+ w1.base.bitStream.buf.length == w3.base.bitStream.buf.length && BitStream .bitIndex(w3.base.bitStream.buf.length, w3.base.bitStream.currentByte, w3.base.bitStream.currentBit) == BitStream .bitIndex(w1.base.bitStream.buf.length, w1.base.bitStream.currentByte, w1.base.bitStream.currentBit) + encodedSizeInBits
230+ && w1.isPrefixOf(w3) && {
231+ val (r1, r3) = ACN .reader(w1, w3)
232+ validateOffsetBitsContentIrrelevancyLemma(w1.base.bitStream, w3.base.bitStream.buf, encodedSizeInBits)
233+ val (r3Got, iGot) = r1.dec_Int_PositiveInteger_ConstSize_pure(encodedSizeInBits)
234+ iGot.toRaw.toInt == intVal && r3Got == r3
235+ }
226236 }
227237
228238 // @opaque @inlineOnce
@@ -762,23 +772,63 @@ case class ACN(base: Codec) {
762772 require(BitStream .validate_offset_byte(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit))
763773 require(- 128L <= intVal && intVal <= 127L )
764774 enc_Int_PositiveInteger_ConstSize_8(ULong .fromRaw(intVal & 0xFFL))
775+ }.ensuring { _ =>
776+ val w1 = old(this )
777+ val w3 = this
778+ w1.base.bufLength() == w3.base.bufLength() && BitStream .bitIndex(w3.base.bitStream.buf.length, w3.base.bitStream.currentByte, w3.base.bitStream.currentBit) == BitStream .bitIndex(w1.base.bitStream.buf.length, w1.base.bitStream.currentByte, w1.base.bitStream.currentBit) + 8
779+ && w1.isPrefixOf(w3) && {
780+ val (r1, r3) = ACN .reader(w1, w3)
781+ validateOffsetBitsContentIrrelevancyLemma(w1.base.bitStream, w3.base.bitStream.buf, 8 )
782+ val (r3Got, iGot) = r1.dec_Int_TwosComplement_ConstSize_8_pure()
783+ iGot == intVal && r3Got == r3
784+ }
765785 }
766786
767787 def enc_Int_TwosComplement_ConstSize_big_endian_16 (intVal : Long ): Unit = {
768788 require(BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, 16 ))
769789 require(- 32768L <= intVal && intVal <= 32767L )
770790 enc_Int_PositiveInteger_ConstSize_big_endian_16(ULong .fromRaw(intVal & 0xFFFFL))
791+ }.ensuring { _ =>
792+ val w1 = old(this )
793+ val w3 = this
794+ w1.base.bufLength() == w3.base.bufLength() && BitStream .bitIndex(w3.base.bitStream.buf.length, w3.base.bitStream.currentByte, w3.base.bitStream.currentBit) == BitStream .bitIndex(w1.base.bitStream.buf.length, w1.base.bitStream.currentByte, w1.base.bitStream.currentBit) + 16
795+ && w1.isPrefixOf(w3) && {
796+ val (r1, r3) = ACN .reader(w1, w3)
797+ validateOffsetBitsContentIrrelevancyLemma(w1.base.bitStream, w3.base.bitStream.buf, 16 )
798+ val (r3Got, iGot) = r1.dec_Int_TwosComplement_ConstSize_big_endian_16_pure()
799+ iGot == intVal && r3Got == r3
800+ }
771801 }
772802
773803 def enc_Int_TwosComplement_ConstSize_big_endian_32 (intVal : Long ): Unit = {
774804 require(BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, 32 ))
775805 require(- 2147483648L <= intVal && intVal <= 2147483647L )
776806 enc_Int_PositiveInteger_ConstSize_big_endian_32(ULong .fromRaw(intVal & 0xFFFFFFFFL))
807+ }.ensuring { _ =>
808+ val w1 = old(this )
809+ val w3 = this
810+ w1.base.bufLength() == w3.base.bufLength() && BitStream .bitIndex(w3.base.bitStream.buf.length, w3.base.bitStream.currentByte, w3.base.bitStream.currentBit) == BitStream .bitIndex(w1.base.bitStream.buf.length, w1.base.bitStream.currentByte, w1.base.bitStream.currentBit) + 32
811+ && w1.isPrefixOf(w3) && {
812+ val (r1, r3) = ACN .reader(w1, w3)
813+ validateOffsetBitsContentIrrelevancyLemma(w1.base.bitStream, w3.base.bitStream.buf, 32 )
814+ val (r3Got, iGot) = r1.dec_Int_TwosComplement_ConstSize_big_endian_32_pure()
815+ iGot == intVal && r3Got == r3
816+ }
777817 }
778818
779819 def enc_Int_TwosComplement_ConstSize_big_endian_64 (intVal : Long ): Unit = {
780820 require(BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, 64 ))
781821 enc_Int_PositiveInteger_ConstSize_big_endian_64(ULong .fromRaw(intVal))
822+ }.ensuring { _ =>
823+ val w1 = old(this )
824+ val w3 = this
825+ w1.base.bufLength() == w3.base.bufLength() && BitStream .bitIndex(w3.base.bitStream.buf.length, w3.base.bitStream.currentByte, w3.base.bitStream.currentBit) == BitStream .bitIndex(w1.base.bitStream.buf.length, w1.base.bitStream.currentByte, w1.base.bitStream.currentBit) + 64
826+ && w1.isPrefixOf(w3) && {
827+ val (r1, r3) = ACN .reader(w1, w3)
828+ validateOffsetBitsContentIrrelevancyLemma(w1.base.bitStream, w3.base.bitStream.buf, 64 )
829+ val (r3Got, iGot) = r1.dec_Int_TwosComplement_ConstSize_big_endian_64_pure()
830+ iGot == intVal && r3Got == r3
831+ }
782832 }
783833
784834 def enc_Int_TwosComplement_ConstSize_little_endian_16 (intVal : Long ): Unit = {
@@ -832,6 +882,13 @@ case class ACN(base: Codec) {
832882 (cpy, l)
833883 }
834884
885+ @ ghost @ pure
886+ def dec_Int_TwosComplement_ConstSize_8_pure (): (ACN , Long ) = {
887+
888+ val cpy = snapshot(this )
889+ val l = cpy.dec_Int_TwosComplement_ConstSize_8()
890+ (cpy, l)
891+ }
835892
836893 def dec_Int_TwosComplement_ConstSize_8 (): Long = {
837894 if (! BitStream .validate_offset_byte(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit) ) then
@@ -840,12 +897,28 @@ case class ACN(base: Codec) {
840897 uint2int(dec_Int_PositiveInteger_ConstSize_8(), 1 )
841898 }
842899
900+ @ ghost @ pure
901+ def dec_Int_TwosComplement_ConstSize_big_endian_16_pure (): (ACN , Long ) = {
902+
903+ val cpy = snapshot(this )
904+ val l = cpy.dec_Int_TwosComplement_ConstSize_big_endian_16()
905+ (cpy, l)
906+ }
907+
843908 def dec_Int_TwosComplement_ConstSize_big_endian_16 (): Long = {
844909 if (! BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, 16 ) ) then
845910 0L
846911 else
847912 uint2int(dec_Int_PositiveInteger_ConstSize_big_endian_16(), NO_OF_BYTES_IN_JVM_SHORT )
848913 }
914+
915+ @ ghost @ pure
916+ def dec_Int_TwosComplement_ConstSize_big_endian_32_pure (): (ACN , Long ) = {
917+
918+ val cpy = snapshot(this )
919+ val l = cpy.dec_Int_TwosComplement_ConstSize_big_endian_32()
920+ (cpy, l)
921+ }
849922
850923 def dec_Int_TwosComplement_ConstSize_big_endian_32 (): Long = {
851924 if (! BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, 32 )) then
@@ -854,6 +927,14 @@ case class ACN(base: Codec) {
854927 uint2int(dec_Int_PositiveInteger_ConstSize_big_endian_32(), NO_OF_BYTES_IN_JVM_INT )
855928 }
856929
930+ @ ghost @ pure
931+ def dec_Int_TwosComplement_ConstSize_big_endian_64_pure (): (ACN , Long ) = {
932+
933+ val cpy = snapshot(this )
934+ val l = cpy.dec_Int_TwosComplement_ConstSize_big_endian_64()
935+ (cpy, l)
936+ }
937+
857938 def dec_Int_TwosComplement_ConstSize_big_endian_64 (): Long = {
858939 if (! BitStream .validate_offset_bits(base.bitStream.buf.length, base.bitStream.currentByte, base.bitStream.currentBit, 64 )) then
859940 0L
0 commit comments