raoofha / haltingproblem Goto Github PK
View Code? Open in Web Editor NEWhalting problem
halting problem
in lambda calculus we can define -0 as (λf.λy.y) and 0 as (λf.λn.n), can we use this as a way to solve undecidable problem?
using the following functions only
{
let enc = (a) => { if(typeof(a) === "bigint" || a === undefined) return a || 0n; else if (typeof(a) === "string") return BigInt("0x"+Array.from((new TextEncoder()).encode(a)).map((c)=>c.toString(16).toUpperCase().padStart(2,"0")).reverse().join("")); else throw new SyntaxError(); }
div = (a,b) => { if((typeof(a) === "bigint" || a === undefined || typeof(a) === "string") && (typeof(b) === "bigint" || b === undefined || typeof(b) === "string") ) try{ return (enc(a)/enc(b)); }catch(e){ if(typeof(a) === "string") { throw a; } else { throw a || 0n; } } else throw new SyntaxError(); }
sub = (a,b) => (enc(a)-enc(b))
mul = (a,b) => (enc(a)*enc(b))
}
and a main function of the form
main = (...) => main(...)
it seems to me that we can define a halting function
halting problem is usually defined like this
but if we define it like this
and use
is there a Godel like sentence for Blindfolded Arithmetic (and its variants where there are unlimited number of registers and instruction can contains numbers and subtraction is truncated-subtraction) ?
why Godel came up with the Godel's sentence in the first place while according to Wikipedia he was interested in Leibniz Characteristica universalis: "The logician Kurt Gödel, on the other hand, believed that the characteristica universalis was feasible, and that its development would revolutionize mathematical practice (Dawson 1997)
"
considering these set of numbers
is
it seems that diagonalization argument does not work for call by value lambda calculus
so we can have a lambda abstraction that takes Godel number of a lambda term as input and evaluate to 1 or 0 depending on whether the lambda term has a normal form or not
it seems like that if we add an error instruction to LOOP programming language it becomes turing complete because as far as I know all proof for total but not primitive recursive functions rely on diagonalization, and the argument that the LOOP+error can not compute the Ackermann function is invalid because a universal program is a function from String to String so you have to consider that when you want to compute a function from N to N
it seems to me that div, mul and sub can compute the set of partial recursive functions
in this book they wrote
The class of partial recursive functions does have a basis.
This follows from the existence of a universal Turing machine.
The function associated with the universal Turing machine,
together with a few other elementary functions gives a basis for the partial recursive functions
so if there is a universal function from String to String that use division by zero or similar partial function to compute it's value then we have total and turing complete language that can compute partial functions
it seems to me there must be a universal Diophantine polynomial with two parameters and zero unknowns
it seems to me that undecidability does not imply unsolvability
imagine we have a partial solution to the totality problem (the problem of determining whether a given computer program will halt for every input) meaning we have a semi-algorithm that correctly halt on most but not all of it's input, let's call it isTotal_0
then we can write the following program to solve the totality problem
function isTotal(p)
{
q = substn(isTotal,p);
if(isTotal_0(q))
{
return isTotal_0(p);
}
else
{
console.log(0);
while(1);
}
}
then we can solve the halting problem using isTotal
function h(p,n)
{
return isTotal(substn(p,n));
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.