Exact algebraic RAM instances #
Values are tagged natural words or exact field elements. Only the natural arm can address
memory; a configuration w bounds words and control labels by 2 ^ w. Arithmetic on words
faults on overflow, subtraction underflow, or zero divisors. Field arithmetic is exact;
division by zero faults. There is a one-way word-to-field operation, no field-to-word cast,
floor, transcendental operation, or square root.
Programs contain natural-word and rational literal symbols, never arbitrary field constants. A rational literal faults when its denominator becomes zero in the field. Thus constants are countable syntax even for the real model; positive characteristic is handled explicitly.
The real instance follows the separation of word addresses and exact real values in
Erickson, van der Hoog, and Miltzow, §6.1. This is a tagged,
finite-register variant with one tagged memory, not their literal pair of word/real arrays.
It also uses checked word arithmetic rather than modular arithmetic. The real interpretation
is noncomputable mathematical semantics. Prime ZMod instances are executable and offer
equality, but no ordering of field elements. Every instruction uses the generic core's unit
cost; no bit-cost or Turing-machine implementation of exact real arithmetic is claimed.
Main definitions #
Algebraic.model: a field with an explicitly supplied optional strict comparison.Algebraic.real: exact real arithmetic and comparison with bounded natural addresses.Algebraic.primeField: exact prime-field arithmetic with bounded natural addresses.
References #
- [Erickson, van der Hoog, and Miltzow, Smoothing the Gap Between NP and ER] [EvdHM24], §6.1.
Instances For
Typed word and field operations. Mixed tags fault except for toField.
- wordAdd : Operation
Natural addition, checked for overflow by result admissibility.
- wordSub : Operation
Natural subtraction, undefined on underflow.
- wordMul : Operation
Natural multiplication, checked for overflow by result admissibility.
- wordDiv : Operation
Natural quotient, undefined at zero divisor.
- wordMod : Operation
Natural remainder, undefined at zero divisor.
- add : Operation
Exact addition.
- sub : Operation
Exact subtraction.
- mul : Operation
Exact multiplication.
- div : Operation
Exact division, undefined at zero divisor.
- neg : Operation
Exact additive inverse.
- toField : Operation
Convert a natural word to its field value, with no inverse conversion.
Instances For
Unary conversion/negation and binary arithmetic.
Instances For
The algebraic operation signature.
Instances For
Every test takes two registers.
Instances For
Interpret rational symbols only when the denominator is nonzero in the field.
Instances For
The tagged field model; less determines which field-order tests are available.
Instances For
Exact real RAM semantics, with decidable equality/order supplied classically.