Monday, August 29, 2022

Digest for comp.lang.c++@googlegroups.com - 8 updates in 4 topics

olcott <NoOne@NoWhere.com>: Aug 28 10:11PM -0500

On 8/28/2022 9:57 PM, Mike Terry wrote:
> and bow out comfortably... [the latter is actually not an unreasonable
> path for you]
 
> Mike.
 
I can't possibly publish *UNTIL AFTER I AM UNDERSTOOD*
 
If people fully understood what I am saying then they would understand
that that the dogma of computer science textbooks that say that H(P,P)
must base its halt status decision on the behavior of P(P) is incorrect.
 
They have to very carefully to go through every single detail of my
explanation of exactly how and why it is incorrect and
 
*utterly stop short-circuiting to the dogma*
*utterly stop short-circuiting to the dogma*
*utterly stop short-circuiting to the dogma*
 
One of the ways that they short circuit is to say that it is a
definition thus cannot be incorrect. A definition can be incorrect
*only* when it directly contradicts other correct definitions.
 
 
--
Copyright 2022 Pete Olcott
 
"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer
Juha Nieminen <nospam@thanks.invalid>: Aug 29 11:24AM


> When we study the theory of computation using physically existing
> machines such as the x86 architecture then the incoherent abstract ideas
> are shown to be incoherent in that they cannot be physically implemented.
 
You can't limit yourself to a particular computer architecture because if
you do, then your results are useless.
 
If, for example, we limit ourselves to the x86 computer architecture, then
in principle every single algorithm is technically either O(1) or can't be
computed. Which is a completely useless result.
olcott <NoOne@NoWhere.com>: Aug 29 01:01PM -0500

On 8/29/2022 6:24 AM, Juha Nieminen wrote:
 
> If, for example, we limit ourselves to the x86 computer architecture, then
> in principle every single algorithm is technically either O(1) or can't be
> computed. Which is a completely useless result.
 
By moving from an abstract model of computation where every detail is
merely imagined and never concretely demonstrated it is possible to
imaging that a decider must return a result to every caller even in the
case where the function call is not even executed.
 
When we move to a concrete model of computation we know that it is
utterly ridiculous that a program that is never executed produces any
output. From this we can know that decider are not supposed to return
any values when a function call to them is never actually executed.
 
void P(ptr x)
{
H(x, x);
return;
}
 
int main()
{
Output("Input_Halts = ", H(P, P));
}
 
 
_Px()
[00001102](01) 55 push ebp
[00001103](02) 8bec mov ebp,esp
[00001105](03) 8b4508 mov eax,[ebp+08]
[00001108](01) 50 push eax // push P
[00001109](03) 8b4d08 mov ecx,[ebp+08]
[0000110c](01) 51 push ecx // push P
[0000110d](05) e880fdffff call 00000e92 // call H
[00001112](03) 83c408 add esp,+08
[00001115](01) 5d pop ebp
[00001116](01) c3 ret
Size in bytes:(0021) [00001116]
 
H aborts its simulation of P as soon as H sees that P would call H at
machine address [0000110d] before this call is even executed.
 
According to what two people have said computer science requires
deciders to return values to their callers even if the call is never
executed.
 
--
Copyright 2022 Pete Olcott
 
"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer
Bonita Montero <Bonita.Montero@gmail.com>: Aug 29 04:48PM +0200

If you throw a system_error with system_category and a platform-specific
error code as an integer the error-code is translated by the runtime to
a platform-specific error string. I think under Windows FormatMessage()
is used and under Unix strerror() is used(). This translation is done
by the error_cateogy-subclass you supply while throwing the error.
Unfortunately under Windows this error string isn't localized. So I
wrote my own error_cagegory subclass for Win32 and Unix:
 
// xsystem_category.h
 
#pragma once
#include <system_error>
 
struct xsystem_category : public std::error_category
{
xsystem_category() = default;
xsystem_category( xsystem_category const & ) = delete;
virtual ~xsystem_category() override = default;
void operator =( xsystem_category const & ) = delete;
virtual char const *name() const noexcept override;
virtual std::error_condition default_error_condition( int code ) const
noexcept override;
virtual bool equivalent( int code, std::error_condition const
&condition ) const noexcept override;
virtual bool equivalent( std::error_code const &code, int condition )
const noexcept override;
virtual std::string message( int condition ) const override;
};
 
// xsystem_category.cpp
 
#if defined(_WIN32)
#include <Windows.h>
#elif defined(__unix__)
#include <string.h>
#include <locale.h>

No comments: