In the literature of algorithms, the specific computation model is often not explicit as it is assumed that the model of computation is the RAM (Random Access Machine) model. However, the RAM model itself is ill-founded in the literature, with disparate definitions and no unified results. The ambition of this paper is to found the RAM model from scratch by exhibiting a RAM model that enjoys interesting algorithmic properties and the robustness of its complexity classes, notably LIN, the class of linear-time computable problems, or the now well-known CONST-DELAY-lin class of enumeration problems computable with constant delay after linear-time preprocessing, The computation model that we define is a RAM whose contents and addresses of registers are $O(N)$, where $N$ is the size (number of registers) of the input, and where the time cost of each instruction is 1 (unit cost criterion). The key to the foundation of our RAM model will be to prove that even if addition is the only primitive operation, such a RAM can still compute all the basic arithmetic operations in constant time after a linear-time preprocessing. Moreover, while the RAM handles only $O(N)$ integers in each register, we will show that our RAM can handle $O(N^d)$ integers, for any fixed d, by storing them on $O(d)$ registers and we will have surprising algorithms that computes many operations acting on these "polynomial" integers -- addition, subtraction, multiplication, division, exponential, integer logarithm, integer square root (or $c$-th root, for any integer $c$), bitwise logical operations, and, more generally, any operation computable in linear time on a cellular automaton -- in constant time after a linear-time preprocessing.
翻译:摘要:在算法文献中,具体的计算模型通常并不明确,因为通常假设计算模型为RAM(随机存取机)模型。然而,RAM模型本身在文献中缺乏坚实基础,存在多种不同定义且尚未形成统一结论。本文的目标是通过构建一种兼具有趣算法性质与复杂度类鲁棒性的RAM模型,从零开始为RAM模型奠定基础——特别是LIN类(线性时间可计算问题类)以及经过线性时间预处理后可用常数延迟计算的枚举问题类CONST-DELAY-lin。我们定义的计算模型是一种RAM,其寄存器的内容与地址均为$O(N)$(其中$N$为输入规模,即寄存器数量),且每条指令的时间代价为1(单位代价准则)。构建该RAM模型的核心在于证明:即使加法是唯一的基本运算,此类RAM在经过线性时间预处理后,仍能在常数时间内完成所有基本算术运算。进一步地,尽管该RAM每个寄存器仅能处理$O(N)$大小的整数,但我们将展示通过将整数存储在$O(d)$个寄存器中,该RAM可处理任意固定$d$对应的$O(N^d)$规模整数。同时,我们将提出令人惊奇的算法,使得经过线性时间预处理后,能在常数时间内执行作用于这些"多项式"整数的多种运算——包括加法、减法、乘法、除法、指数运算、整数对数、整数平方根(或任意整数$c$次根)、按位逻辑运算,更一般地,任何可在细胞自动机上以线性时间计算的运算。