Bounded signed integer RAM #
Signed.model instantiates the generic RAM with the operational choices of
LeanTrominoes.ComplexityAbstract.RAM at revision 6d5b36c1
(MIT–ULB CompGeom Group). Values are integers, addresses are naturals, and
the configuration is a word width. Every produced, moved, stored, or returned value must fit
the signed word range. Address registers must be nonnegative and below 2^w; the current
program counter and every continuation label must also be below 2^w.
Arithmetic uses Lean's integer division and remainder, including their total zero-divisor
conventions. Each instruction, including halt, costs one. This is the source's signed model,
not the unsigned Cslib.WordRAM instance; in particular subtraction is not truncated.
Main definitions #
Arithmetic,Test: the original arithmetic and comparison symbols.Fits,model: signed word bounds and the generic RAM instance.initial,InputFits: the original input layout and admissibility predicate.
Main results #
References #
The five arithmetic operations of the original signed RAM.
- add : Arithmetic
- sub : Arithmetic
- mul : Arithmetic
- div : Arithmetic
- mod : Arithmetic
Instances For
Integer arithmetic, with Lean's total division and remainder conventions.
Instances For
Equality and signed strict comparison.
Instances For
Signed two's-complement range, requiring a positive word width.
Instances For
Zero fits at every positive width.
One fits at every width of at least two bits.
The original bounded signed integer RAM, as a generic machine model.
All writes and halts check Fits; addresses and control labels use the unsigned range.