prop/halt.rs
1//! # Improved Halting Problem
2//!
3//! This module is based on [hooo].
4//!
5//! ### Background
6//!
7//! The Improved Halting Problem is an attempt to change perspective of the Halting problem
8//! to something more practical which can not be defeated by a simple counter-example.
9//! The idea has been floating around in the AdvancedResearch forum for a couple years,
10//! but since Elaine M. Landry (Ph.D.) is advancing towards an "as-if mathematics"
11//! (e.g. [this lecture](https://www.youtube.com/watch?v=XRKHSlFvq4Q&t=17s))
12//! we will try to make some progress in this direction before Landry's position gets misunderstood.
13//!
14//! It seems Landry is on the right track, but the current view in AdvancedResearch is that
15//! regression of relative consistency proofs might be caused by a technicality
16//! about modal fixed points (use of point free predicates of one argument),
17//! thus Landry's motivation for developing "as-if mathematics" is not yet convincing.
18//! It can also be that the current view of AdvancedResearch is wrong.
19//!
20//! However, "as-if mathematics" as an idea might be a weaker position implied by
21//! Inside and Outside theories. Therefore, the current view of AdvancedResearch is stronger
22//! and we would like to solve possible issues about misinterpreting "as-if mathematics".
23//!
24//! ### Introduction
25//!
26//! The standard Halting Problem can be thought of as an axiom of excluded middle:
27//!
28//! ```text
29//! (a ⋁ ¬a)^true
30//! ```
31//!
32//! Where `a` means "program A terminates".
33//!
34//! The problem with the standard Halting Problem is that by using the solver as oracle in
35//! some program A, A can decide to not terminate if the solver says A terminates,
36//! and if the solver says A does not terminate, then A terminates.
37//! Therefore, solving the standard Halting Problem is undecidable.
38//!
39//! The Improved Halting Problem rephrases the problem such that there is no axiom of excluded
40//! middle, but instead the solver has a stonger meta-property that it can detect paradoxes
41//! caused by its own counter-factual scenario where it says a program terminates:
42//!
43//! ```text
44//! (a^true ⋁ false^(a^true))^true
45//! ```
46//!
47//! So, either the solver can prove a program halts without making any assumptions,
48//! or it can detect a paradox. It is easy to show that ([neg_to_para]):
49//!
50//! ```text
51//! (¬a => false^(a^true))^true
52//! ```
53//!
54//! This means, if the program does not halt, then the solver returns `false`.
55
56use super::*;
57use hooo::*;
58
59/// Improved Halting, implemented by Halting proposition of programs.
60pub trait Halt: Prop {
61 /// `a^true ⋁ false^(a^true)`.
62 fn halt() -> Or<Tauto<Self>, Para<Tauto<Self>>>;
63}
64
65/// `¬a => false^(a^true)`.
66pub fn neg_to_para<A: Halt>(not_a: Not<A>) -> Para<Tauto<A>> {
67 match A::halt() {
68 Left(tauto_a) => not::absurd(not_a, tauto_a(True)),
69 Right(para_tauto_a) => para_tauto_a,
70 }
71}