Abstract
We look at some decision problems for programs using the RAM (random access machine) model of computation. Under this model, each instruction takes one step to execute. We obtain positive as well as negative results. For example, we show that there is an algorithm to determine given a positive integer k and a program P with one input variable over the instruction set { x ← 0, x ← x + 1, x ← x ← 1, x ← x + y, x ← x − y, x ← x ∗ y, x ← x y , if p( x) then halt, halt, if p( x) then goto l, goto 1}, where x y is integer division and p( x) is a predicate of the form x < 0, x = 0, x ≠ 0, x > 0, whether P halts on all integer inputs in at most k steps. The problem is also decidable for multi-input programs with no multiplication and division instructions. In contrast, the problem is undecidable for programs with two input variables over the instruction set { x ← 0, x ← x + 1, x ← x − y, x ← x y , if x = 0 then halt, halt}, even when only total programs (i.e., no division by 0 occurs during any computation) are considered. This last result also holds when x ← x y is replaced by multiplication, x ← x ∗ y, but the number of input variables needed is large.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.