Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

[It is] best to confuse only one issue at a time. -- K&R


devel / comp.lang.python / Re: Question(s)

SubjectAuthor
* Re: Question(s)o1bigtenor
`* Re: Question(s)Michael F. Stemper
 `- RE: Question(s)<avi.e.gross

1
Re: Question(s)

<mailman.40.1698189353.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24183&group=comp.lang.python#24183

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: o1bigte...@gmail.com (o1bigtenor)
Newsgroups: comp.lang.python
Subject: Re: Question(s)
Date: Tue, 24 Oct 2023 18:15:15 -0500
Lines: 47
Message-ID: <mailman.40.1698189353.3828.python-list@python.org>
References: <CAPpdf58WXyJs+Rd_GnbS-6dW8bPNt5DsojnVN5_ep+ebNx36Pw@mail.gmail.com>
<58b56dbe-646c-4a94-8102-ac2cf6efe233@tompassin.net>
<CAPpdf5_WVe07YVm-dZVV1mpZSWB6v4Z0itRsfYxYVdt8bWt0Ng@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de w+5g10FK9E1+2Tzn8Ul3TA47jujXg/S503p+Ivmnil0w==
Cancel-Lock: sha1:OBCY39lCWexo31Ynb2KRSor0KoQ= sha256:aKiNiLhS5regev3mFNP1nYfctSS3cSK33BJvz3sN3gE=
Return-Path: <o1bigtenor@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=WoYdWzEo;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.023
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'absolute': 0.05;
'programming.': 0.05; '2023': 0.07; 'else.': 0.07; 'cc:addr
:python-list': 0.09; 'received:mail-lf1-x134.google.com': 0.09;
'responses': 0.09; 'cc:no real name:2**0': 0.14; 'that.': 0.15;
'arbitrary': 0.16; 'bugs': 0.16; 'bugs.': 0.16; 'create,': 0.16;
'impossible': 0.16; 'mathematical': 0.16; 'personally,': 0.16;
'sounds': 0.16; 'which,': 0.16; 'wrote:': 0.16; 'hardware': 0.19;
'subject:Question': 0.19; 'tue,': 0.19; 'cc:addr:python.org':
0.20; "i've": 0.22; 'basically': 0.22; 'code': 0.23; 'anything':
0.25; 'cannot': 0.25; 'cc:2**0': 0.25; 'programming': 0.25;
'done': 0.28; 'asked': 0.29; 'program': 0.31; 'mission': 0.32;
'python-list': 0.32; 'structure': 0.32; 'message-
id:@mail.gmail.com': 0.32; "i'm": 0.33; 'there': 0.33; 'header:In-
Reply-To:1': 0.34; 'received:google.com': 0.34; 'developed': 0.35;
'question.': 0.35; 'from:addr:gmail.com': 0.35; 'couple': 0.37;
'could': 0.38; 'read': 0.38; 'difficult': 0.40; 'learn': 0.40;
'something': 0.40; 'want': 0.40; 'team': 0.60; 'here': 0.62;
'subject': 0.63; 'full': 0.64; 'subject:(': 0.64; 'your': 0.64;
'touch': 0.65; 'well': 0.65; 'less': 0.65; 'technical': 0.67;
'experience.': 0.70; 'interesting': 0.71; 'read,': 0.75;
'business': 0.77; 'out.': 0.80; 'ambitious': 0.84; 'certainty':
0.84; 'itself.': 0.84; 'moon': 0.84; 'errors,': 0.91; 'mistakes':
0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1698189351; x=1698794151; darn=python.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=kxRr6/n1gtqLemmKhNHsQSu2mRG7Uu0Hp4bWUI7E3Sg=;
b=WoYdWzEo0OSGfNlEFEIHQKKmuyHRmM846SNMEIdpYI746Fh+ZZdu7ba887uNJiZfxq
Z1liYJC2QSLW1y3SjRbriBuloehjj7uI1RoBiXtBi6InH8upUwQfzsFV955liMpIrzm8
UjBt8j3HsQk9Hr1RjnFgY8sZ/2cZWSxt5tN5xLgRA5F76tzBQiiCgCBQ6mu9jGLpHpLJ
7GbR+qRYxBxqrIWnkhizx/sgRRxibNgbAyQ1TCg3rgQWAC+eDWVzEmmSlhko5UiOvzml
e52G6XeMcJPMg2YomuvWCgYkP0k5+M/G6XoH+daEBEtPrEKFnzDsrdOgqRT4cuyaJJiw
JdGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1698189351; x=1698794151;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=kxRr6/n1gtqLemmKhNHsQSu2mRG7Uu0Hp4bWUI7E3Sg=;
b=gCkjs1BTme8OuRLlCKIy35lLvo5EU2IyZv06pp4uj1yVbUmigLwMZupxUMqa/ElY1O
nufnmwO1hYYCPvSZz0u4lO7VptIMTaWtH1NPsE13nhZgEUBxGTQ0cW2EaFVnltdFQGhn
IHf6w6Zv1iw+ZriRMnrKO7mwt0oFVZ3P34Sr5YOP5cgUM/KS2/OgL3SLf6Bwo/7KTJLp
QzvBxvHxF/67WK+nmdJs3//oScdwDoniPAUiPaHDUxITQOAU9mmXljLAkXoqr8r9Y8jm
osD4UlpCCNDpSr8zNsIEYJFpnp/s/efGQouwhJNMIBssxZlt7OJETcjdbHlKaAWwZHtg
iQrA==
X-Gm-Message-State: AOJu0YzF4fh2vhBV8itKZRRh8S0gsR1IVyKaNUs7kQzEp3olNij8GGSK
vTdqMT930NQ8kyDkEirRUSIemINUzgSzxVwB+UKDM/ih
X-Google-Smtp-Source: AGHT+IHFEL4WKmeKdvpP8qS1gN+R7MuMxoN6rw9O3VeCl68RfjMrTHcEnsGMimxRGTwX1+8cS6ps2MZspdy0mKPqcnU=
X-Received: by 2002:a05:6512:52a:b0:507:cb04:59d4 with SMTP id
o10-20020a056512052a00b00507cb0459d4mr8846293lfc.8.1698189351160; Tue, 24 Oct
2023 16:15:51 -0700 (PDT)
In-Reply-To: <58b56dbe-646c-4a94-8102-ac2cf6efe233@tompassin.net>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPpdf5_WVe07YVm-dZVV1mpZSWB6v4Z0itRsfYxYVdt8bWt0Ng@mail.gmail.com>
X-Mailman-Original-References: <CAPpdf58WXyJs+Rd_GnbS-6dW8bPNt5DsojnVN5_ep+ebNx36Pw@mail.gmail.com>
<58b56dbe-646c-4a94-8102-ac2cf6efe233@tompassin.net>
 by: o1bigtenor - Tue, 24 Oct 2023 23:15 UTC

On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list
<python-list@python.org> wrote:
>
snip
>
> By now you have read many responses that basically say that you cannot
> prove that a given program has no errors, even apart from the hardware
> question. Even if it could be done, the kind of specification that you
> would need would in itself be difficult to create, read, and understand,
> and would be subject to bugs itself.
>
> Something less ambitious than a full proof of correctness of an
> arbitrary program can sometimes be achieved. The programming team for
> the Apollo moon mission developed a system which, if you would write
> your requirements in a certain way, could generate correct C code for them.
>
> You won't be doing that.
>
> Here I want to point out something else. You say you are just getting
> into programming. You are going to be making many mistakes and errors,
> and there will be many things about programming you won't understand
> until you get some good solid experience. That's not anything to do
> with you personally, that's just how it will play out.
>
> So be prepared to learn from your mistakes and bugs. They are how you
> learn the nuts and bolts of the business of programming.
>

I am fully expecting to make mistakes (grin!).
I have a couple trades tickets - - - I've done more than a touch of technical
learning so mistakes are not scary.

What is interesting about this is the absolute certainty that it is impossible
to program so that that program is provably correct.
Somehow - - - well - - to me that sounds that programming is illogical.

If I set up a set of mathematical problems (linked) I can prove that the
logic structure of my answer is correct.

That's what I'm looking to do with the programming.

(Is that different than the question(s) that I've asked - - - dunno.)

Stimulating interaction for sure (grin!).

Re: Question(s)

<uhb5gv$pflc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24215&group=comp.lang.python#24215

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: michael....@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: Question(s)
Date: Wed, 25 Oct 2023 08:34:13 -0500
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <uhb5gv$pflc$1@dont-email.me>
References: <CAPpdf58WXyJs+Rd_GnbS-6dW8bPNt5DsojnVN5_ep+ebNx36Pw@mail.gmail.com>
<58b56dbe-646c-4a94-8102-ac2cf6efe233@tompassin.net>
<CAPpdf5_WVe07YVm-dZVV1mpZSWB6v4Z0itRsfYxYVdt8bWt0Ng@mail.gmail.com>
<mailman.40.1698189353.3828.python-list@python.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 25 Oct 2023 13:34:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3cdd55664877c01d38208e8c0a09d64c";
logging-data="835244"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/INOdTi1VE0rFoyn+Mm//obFaBYun77iY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:p9EbEZSBSQsKvr9muKhzbaOfVTg=
Content-Language: en-US
In-Reply-To: <mailman.40.1698189353.3828.python-list@python.org>
 by: Michael F. Stemper - Wed, 25 Oct 2023 13:34 UTC

On 24/10/2023 18.15, o1bigtenor wrote:

> What is interesting about this is the absolute certainty that it is impossible
> to program so that that program is provably correct.

Not entirely true. If I was to write a program to calculate Fibonacci
numbers, or echo back user input, that program could be proven correct.
But, there is a huge set of programs for which it is not possible to
prove correctness.

In fact, there is a huge (countably infinite) set of programs for which it
is not even possible to prove that the program will halt.

Somebody already pointed you at a page discussing "The Halting Problem".
You really should read up on this.

> Somehow - - - well - - to me that sounds that programming is illogical.
>
> If I set up a set of mathematical problems (linked) I can prove that the
> logic structure of my answer is correct.

Exactly the same situation. There are many (again, countably infinite)
mathematical statements where it is not possible to prove that the statement
is either true or false. I want to be clear that this is not the same as
"we haven't figured out how to do it yet." It is a case of "it is mathematically
possible to show that we can't either prove or disprove statement <X>."

Look up Kurt Gödel's work on mathematical incompleteness, and some of the
statements that fall into this category, such as the Continuum Hypothesis
or the Parallel Postulate.

As I said at the beginning, there are a lot of programs that can be
proven correct or incorrect. But, there are a lot more that cannot.

--
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.

RE: Question(s)

<mailman.81.1698283562.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24235&group=comp.lang.python#24235

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From:
Newsgroups: comp.lang.python
Subject: RE: Question(s)
Date: Wed, 25 Oct 2023 21:25:58 -0400
Lines: 135
Message-ID: <mailman.81.1698283562.3828.python-list@python.org>
References: <CAPpdf58WXyJs+Rd_GnbS-6dW8bPNt5DsojnVN5_ep+ebNx36Pw@mail.gmail.com>
<58b56dbe-646c-4a94-8102-ac2cf6efe233@tompassin.net>
<CAPpdf5_WVe07YVm-dZVV1mpZSWB6v4Z0itRsfYxYVdt8bWt0Ng@mail.gmail.com>
<mailman.40.1698189353.3828.python-list@python.org>
<uhb5gv$pflc$1@dont-email.me>
<002101da07ab$5fc5c6d0$1f515470$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de gv2TzTSr9jzk0nRxGFrnYgLO5HVZZL2UO/oiU13v3MLw==
Cancel-Lock: sha1:ppiK5Nx4/V36q5V/o6Uvot+YOMc= sha256:I5obr4gWKPq4BWbQwlkeAy8ARCBBXXKXun418Wd9rbw=
Return-Path: <avi.e.gross@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=DWiFnZvW;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'generated': 0.03; '"it':
0.05; 'absolute': 0.05; 'fairly': 0.05; 'issue.': 0.05;
'parallel': 0.05; 'row': 0.05; '2023': 0.07; 'loop': 0.07;
'fact,': 0.09; 'floating': 0.09; 'infinite': 0.09; 'library,':
0.09; 'memory.': 0.09; 'overhead': 0.09; 'rarely': 0.09;
'received:108': 0.09; 'received:mail-qv1-xf2a.google.com': 0.09;
'smaller': 0.09; 'url:mailman': 0.15; 'memory': 0.15;
'algorithms': 0.16; 'analogy': 0.16; 'assumptions': 0.16; 'bits':
0.16; 'category,': 0.16; 'computers.': 0.16; 'constantly': 0.16;
'constraints.': 0.16; 'division': 0.16; 'division,': 0.16;
'false.': 0.16; 'fibonacci': 0.16; 'generates': 0.16;
'guarantees': 0.16; 'hypothesis': 0.16; 'impossible': 0.16;
'input,': 0.16; 'mathematical': 0.16; 'o1bigtenor': 0.16;
'rounded': 0.16; 'simulation': 0.16; 'somewhat': 0.16; 'sounds':
0.16; 'spending': 0.16; 'stepped': 0.16; 'wrote:': 0.16;
'problem': 0.16; 'python': 0.16; 'larger': 0.17; 'october': 0.17;
"can't": 0.17; 'message-id:@gmail.com': 0.18; 'uses': 0.19; 'bug':
0.19; 'subject:Question': 0.19; 'to:addr:python-list': 0.20;
'language': 0.21; 'written': 0.22; 'ran': 0.22; 'code': 0.23;
'skip:- 10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'section': 0.25; 'url:listinfo': 0.25;
'programming': 0.25; 'url-ip:188.166/16': 0.25; 'anyone': 0.25;
'seems': 0.26; 'task': 0.26; 'wednesday,': 0.26; 'else': 0.27;
'bit': 0.27; 'expect': 0.28; 'example,': 0.28; 'goes': 0.28;
'computer': 0.29; 'environment': 0.29; 'whole': 0.30; 'default':
0.31; 'program,': 0.31; 'url-ip:188/8': 0.31; 'program': 0.31;
'amounts': 0.32; 'divided': 0.32; 'modified': 0.32; 'python-list':
0.32; 'returning': 0.32; 'structure': 0.32; 'zero': 0.32;
'unless': 0.32; 'but': 0.32; 'there': 0.33; 'someone': 0.34;
'same': 0.34; 'core': 0.34; 'header:In-Reply-To:1': 0.34; '100%':
0.66; 'time.': 0.66; 'numbers': 0.67; 'back': 0.67; 'generally':
0.67; 'guaranteed': 0.67; 'maximum': 0.67; 'outside': 0.67;
'exactly': 0.68; 'matter': 0.68; '"we': 0.69; 'certified': 0.69;
'change.': 0.69; 'discussing': 0.69; 'fixing': 0.69; 'lie': 0.69;
'analysis': 0.69; 'times': 0.69; 'free,': 0.70; 'raised': 0.70;
'interesting': 0.71; 'risk': 0.71; 'longer': 0.71; 'little': 0.73;
'reliable': 0.74; 'features': 0.75; 'choice': 0.76; 'limits':
0.76; 'proven': 0.76; 'sent:': 0.78; 'absolutely': 0.84;
'billions': 0.84; 'catch': 0.84; 'certainty': 0.84; 'danger':
0.84; 'dark': 0.84; "else's": 0.84; 'eventually': 0.84; 'handled':
0.84; 'happened,': 0.84; 'hill': 0.84; 'inputs': 0.84; 'lose':
0.84; 'rare': 0.84; 'weird': 0.84; 'dollars': 0.86; 'million':
0.89; 'life,': 0.91; 'somebody': 0.91; 'families': 0.93;
'trusted': 0.93; 'fall': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1698283560; x=1698888360; darn=python.org;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:from:to:cc:subject:date:message-id:reply-to;
bh=GHI3wtD4/N7egg0sqQVY+MU041fe0f5WxVtzywrgMMs=;
b=DWiFnZvWrnep5iu7OCGloZ/TqNd3fhFikJ8b5s1oB1riT4+UBE92txQpP/x1eLAnWl
BGzH+lRVITjiG6xyqk5+qcgnxUFlqKfgK6jkFK1PZpfP2rYS5hZzdm4DOWsRGAe+Qqdo
KCU4zpKEh1LvSErMtxYQeIXrXOSlvei4Zt0yl+POym3VQPsDILz3NKG8dVjMY5behybf
R3OfVu9/FaPR2hoc4yHXTRjlAIyZBhUhGNpVfBGwp8WDwixJU2wPLRmRja9xYVQHFYM7
jay0w0WHAbZy457P/Gp102EfaiFoBwQwCQpQ9Tt5CTRsPa1XI0+yYkoDdaZNzYjA0ol9
99Qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1698283560; x=1698888360;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=GHI3wtD4/N7egg0sqQVY+MU041fe0f5WxVtzywrgMMs=;
b=XJ4x78QbxKf7wxkJn4sg1Rq40MAeHy/y/nsn5oUE7PEGiqlpI2EG5RCinzwwIsqg8B
nyH5k5kitphY5BFoNfl5dBulKJWlzFsKzv79EiJpIusnmuhxrM5OmWARddlM9CF7hJXs
5i8NgYHja0u8YQJn0G67OLo+jEG3+5PrqRGQlbMWcOlftMNnflL3keq9r1N0fY/XqjuA
wQ1x30+Azdn94L8klMqNBKxeJlleGV055tXomZur+6ta0UY4m0ax9K3yxR4POC2Mg3EC
XRwZbT2XAVWxhPCxWJqTskEgmZaZS1Bb5YPcTfBxNym98x8LayMSn091SBJkClJv+7a3
QrxA==
X-Gm-Message-State: AOJu0YwjsPg8Wzfrd+ZDbqtt7vmF9kTa31gSHiK4ktwenvzI0sTxXJxt
T/jqtc3gpYn918q2Pf6Pne4=
X-Google-Smtp-Source: AGHT+IF+Cpu1J+C3lJEGcgHJTyO4Uvtfr1Wa1qhejVSSYHkPuhe1Dz+mqWviBEO5YEfQ4Nbay3BkxA==
X-Received: by 2002:a05:6214:212c:b0:66d:5b9:9276 with SMTP id
r12-20020a056214212c00b0066d05b99276mr24862213qvc.25.1698283559552;
Wed, 25 Oct 2023 18:25:59 -0700 (PDT)
In-Reply-To: <uhb5gv$pflc$1@dont-email.me>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQK+Z3bM93aYhx2z6K+K8JZYCNCqhQGSd+h2AkMP9M8BZeuO7AJyjNL8rlUQN5A=
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <002101da07ab$5fc5c6d0$1f515470$@gmail.com>
X-Mailman-Original-References: <CAPpdf58WXyJs+Rd_GnbS-6dW8bPNt5DsojnVN5_ep+ebNx36Pw@mail.gmail.com>
<58b56dbe-646c-4a94-8102-ac2cf6efe233@tompassin.net>
<CAPpdf5_WVe07YVm-dZVV1mpZSWB6v4Z0itRsfYxYVdt8bWt0Ng@mail.gmail.com>
<mailman.40.1698189353.3828.python-list@python.org>
<uhb5gv$pflc$1@dont-email.me>
 by: - Thu, 26 Oct 2023 01:25 UTC

Just want to add that even when you can prove that an algorithm works absolutely positively, it will often fail on our every finite computers. Consider families of algorithms that do hill climbing to find a minimum and maximum and are guaranteed to get ever closer to a solution given infinite time. In real life, using something like 64 bit or 128 bit floating point representations, you can end up with all kinds of rounding errors and inexactness on some inputs so it goes into a loop of constantly bouncing back and forth between the two sides and never gets any closer to the peak. It may work 99.99% of the time and then mysteriously lock up on some new data.

Or consider an algorithm some use in places like Vegas that is absolutely 100% guaranteed to win. If you bet $1 and lose, simply double your bet as many times as needed and eventually, you should win. Of course, one little problem is that all you ever win is $1. And you might lose 50 times in a row and spend hours and risk ever larger amounts to just win that dollar. Sure, you could just start betting a larger amount like a million dollars and eventually win a million dollars but how long can anyone keep doubling before they have to stop and lose it all. After enough doublings the vet is for billions of dollars and soon thereafter, more than the worth of everything on the planet.

The algorithm is mathematically sound but the result given other realities is not.

A last analogy is the division by zero issue. If your algorithm deals with infinitesimally smaller numbers, it may simply be rounded or truncated to exactly zero. The next time the algorithm does a division, you get a serious error.

So perhaps a PROOF that a real computer program will work would require quite a few constraints. Python already by default supports integers limited only in size by available memory. This can avoid some of the overflow problems when all you are allowed is 64 bits but it remains a constraint and a danger as even a fairly simple algorithm you can PROVE will work, will still fail if your program uses these large integers in ways that make multiple such large integers on machines not designed to extend their memory into whole farms of machines or generates numbers like Googolplex factorial divided by googolplex raised to the log(Googolplex ) power.

Some problems like the above are manageable as in setting limits and simply returning failure without crashing. Many well-designed programs can be trusted to work well as long as certain assumptions are honored. But often it simply is not true and things can change.

Python actually is a good choice for quite a bit and often will not fail where some other environment might but there are few guarantees and thus people often program defensively even in places they expect no problems. As an example, I have written programs that ran for DAYS and generated many millions of files as they chugged along in a simulation and then mysteriously died. I did not bother trying to find out why one program it called failed that rarely to produce a result. I simply wrapped the section that called the occasional offender in the equivalent try/catch for that language and when it happened, did something appropriate and continued. The few occasional errors were a bug in someone else's code that should have handled whatever weird data I threw at it gracefully but didn't, so I added my overhead so I could catch it. The rare event did not matter much given the millions that gave me the analysis I wanted. But the point is even if my code had been certified as guaranteed to be bug free, any time I stepped outside by calling code from anyone else in a library, or an external program, it is no longer guaranteed.

We are now spending quite a bit of time educating someone who seems to have taken on a task without really being generally knowledgeable about much outside the core language and how much of the answer to making the code as reliable as it can be may lie somewhat outside the program as just seen by the interpreter.

And unless this is a one-shot deal, in the real world, programs keep getting modified and new features ofteh added and just fixing one bug can break other parts so you would need to verify things over and over and then freeze.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On Behalf Of Michael F. Stemper via Python-list
Sent: Wednesday, October 25, 2023 9:34 AM
To: python-list@python.org
Subject: Re: Question(s)

On 24/10/2023 18.15, o1bigtenor wrote:

> What is interesting about this is the absolute certainty that it is impossible
> to program so that that program is provably correct.

Not entirely true. If I was to write a program to calculate Fibonacci
numbers, or echo back user input, that program could be proven correct.
But, there is a huge set of programs for which it is not possible to
prove correctness.

In fact, there is a huge (countably infinite) set of programs for which it
is not even possible to prove that the program will halt.

Somebody already pointed you at a page discussing "The Halting Problem".
You really should read up on this.

> Somehow - - - well - - to me that sounds that programming is illogical.
>
> If I set up a set of mathematical problems (linked) I can prove that the
> logic structure of my answer is correct.

Exactly the same situation. There are many (again, countably infinite)
mathematical statements where it is not possible to prove that the statement
is either true or false. I want to be clear that this is not the same as
"we haven't figured out how to do it yet." It is a case of "it is mathematically
possible to show that we can't either prove or disprove statement <X>."

Look up Kurt Gödel's work on mathematical incompleteness, and some of the
statements that fall into this category, such as the Continuum Hypothesis
or the Parallel Postulate.

As I said at the beginning, there are a lot of programs that can be
proven correct or incorrect. But, there are a lot more that cannot.

--
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.

--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor