@@ -203,6 +203,27 @@ The code uses some helper sorts for better readability.
203203 rule toAmount(fromAmount(AMT)) => AMT [simplification, preserves-definedness]
204204 rule fromAmount(toAmount(VAL)) => VAL [simplification, preserves-definedness]
205205
206+ // Amount Round-trip Simplifications:
207+ rule Bytes2Int(
208+ #bytesFrom(
209+ ListItem(Integer(AMOUNT &Int 255, 8, false))
210+ ListItem(Integer(AMOUNT >>Int 8 &Int 255, 8, false))
211+ ListItem(Integer(AMOUNT >>Int 8 >>Int 8 &Int 255, 8, false))
212+ ListItem(Integer(AMOUNT >>Int 8 >>Int 8 >>Int 8 &Int 255, 8, false))
213+ ListItem(Integer(AMOUNT >>Int 8 >>Int 8 >>Int 8 >>Int 8 &Int 255, 8, false))
214+ ListItem(Integer(AMOUNT >>Int 8 >>Int 8 >>Int 8 >>Int 8 >>Int 8 &Int 255, 8, false))
215+ ListItem(Integer(AMOUNT >>Int 8 >>Int 8 >>Int 8 >>Int 8 >>Int 8 >>Int 8 &Int 255, 8, false))
216+ ListItem(Integer(AMOUNT >>Int 8 >>Int 8 >>Int 8 >>Int 8 >>Int 8 >>Int 8 >>Int 8 &Int 255, 8, false))
217+ ) ,
218+ LE,
219+ Unsigned
220+ ) => AMOUNT
221+ [simplification, symbolic(AMOUNT), preserves-definedness]
222+
223+
224+
225+ // ------------------------------------------------------------------------------
226+
206227 syntax Flag ::= Flag ( Int ) // 4 bytes , first byte representing bool. From = 4 bytes, to = read/check all bytes
207228 | FlagError ( Value ) // to make converters total, add an error constructor
208229
0 commit comments