Questions tagged [termination]
30 questions
16
votes
5 answers
Is it provably true/false that for a program, there exists a proof whether it halts or not?
A standalone statement of my question
Given a program that takes no argument, we are interested in whether the program will eventually terminate. My question is this:
Theoretically speaking, can we always find a proof of the…
DatoClement
- 308
- 2
- 9
10
votes
1 answer
What is the chance that this code terminates?
I wrote this Python code, and wondered if it sometimes simply doesn't terminate (assuming we had infinite memory/time and no recursion depth limit).
Intuitively you'd think it terminates, since at some point you must get lucky, and if it doesn't…
orlp
- 13,988
- 1
- 26
- 41
7
votes
2 answers
What are the most expressive, terminating languages?
I'm less interested in languages where you can write almost anything, but then are required to write an accompanying proof that what you wrote terminates.
I'm more interested in the design space of languages inherently confined to certain…
sfultong
- 73
- 3
5
votes
1 answer
Proving program termination in the $\lambda$-calculus
Turing's Checking a large routine:
Finally the checker has to verify that the process comes to an end.
Here again he should be assisted by the programmer giving a further
definite assertion to be verified. This may take the form of a
quantity which…
user1868607
- 2,224
- 14
- 23
5
votes
1 answer
Is there a model of ZF¬C where some program always terminates but has no loop variant?
Wikipedia has a proof that every loop that terminates has a loop variant—a well-founded relation on the state space such that each iteration of the loop results in a state that is less than the previous iteration's state under the relation. Here,…
Aaron Rotenberg
- 3,583
- 14
- 20
4
votes
1 answer
Why does substitution terminate?
I'm formalizing some properties of lambda calculus in Coq and I have some problems proving termination of substitution. My terms are defined as:
Inductive Term :=
TVar: nat -> Term
| TAbs: nat -> Term -> Term
| TApp: Term -> Term -> Term.
and I…
4
votes
3 answers
Termination in infinite-time
Does it make sense to speak of algorithms that take an infinite amount of time to terminate?
In particular, suppose we have a loop with a bound function that is initially positive and is decreased by the loop body each time. Furthermore, suppose…
Musa Al-hassy
- 894
- 1
- 5
- 9
4
votes
1 answer
Is there a fully combinatorial version of MLTT without lambda abstraction?
I have been learning MLTT and working on implementing its type checker referencing Coq's core language specification. Currently, I am at the stage of implementing its termination checker. I find it somewhat dissatisfying that I need to implement a…
12412316
- 173
- 4
3
votes
0 answers
Question about termination of term rewrite systems
Let $\mathcal{R} = (R, \Sigma)$ be a term rewrite system over a signature $\Sigma$ with set of basic rewrite rules $R$. It is known that $\mathcal{R}$ is terminating IF every basic rewrite rule $l \to r \in R$ has the following two properties:
The…
User7819
- 281
- 1
- 6
3
votes
0 answers
Termination of deterministic term rewriting
Consider a simple language:
$$t ::= plus ~ t ~ t ~ | ~ gen ~ t ~ | ~ except ~ N ~ t ~ | ~ N$$
with N constructors plus, gen and except, N being the natural numbers, and $G = \{t_n\}$ a finite, ordered set of terms.
These terms can be evaluated using…
choeger
- 620
- 3
- 8
3
votes
3 answers
Why do we care about termination analysis?
Why is it important to know if a program terminates or not? In particular, what are some consequences of a non-terminating program?
Kvin
- 41
- 2
2
votes
2 answers
Inference of a measure for a decreasing chain
Set $I_n = \{0,\ldots,n-1\}$.
Given integers $v_0,\dots,v_{n-1} \in \mathbb{N}$, find an integer $t>0$, a map $f:\mathbb{N} \times I_n \to \mathbb{N}^t$, and a well-founded order $>_t$ on $\mathbb{N}^t$ such that: $$\forall i \in I_n, m \in…
user1868607
- 2,224
- 14
- 23
2
votes
1 answer
Identifying/equating constants in a term rewrite system
Suppose we have a term rewrite system $\mathcal{R} = (R, \Sigma)$ with basic rewrite rules $R$ over a signature $\Sigma$. Suppose also that this rewrite system $\mathcal{R}$ is confluent and terminating, and that each constant symbol of $\Sigma$ is…
User7819
- 281
- 1
- 6
2
votes
2 answers
Termination of standard encoding of CFG as PDA for words not in the language
The construction of a PDA from a CFG on wikipedia (1) is like a nice exercise for implementing a minimal-and-slow-but-functional parsing algorithm. I have a question about termination of the PDA that is constructed. Specifically, given an input that…
bobismijnnaam
- 205
- 1
- 5
1
vote
1 answer
Stablishing termination of the construction of infinite stream with ranking functions
I'm working with Turing's paradigm to prove termination of programs by annotating functions with ranking functions and I encounter the following example:
def zeros: Stream[Int] = 0 #:: zeros
This is Scala syntax for contructing a stream made of an…
user1868607
- 2,224
- 14
- 23