olcott
unread,Dec 26, 2020, 8:50:22 PM12/26/20You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On 12/26/2020 6:40 PM, Ben Bacarisse wrote:
> olcott <No...@NoWhere.com> writes:
>
>> On 12/24/2020 6:20 PM, Ben Bacarisse wrote:
>>> olcott <No...@NoWhere.com> writes:
>>>
>>>> On 12/23/2020 8:53 PM, Ben Bacarisse wrote:
>>> <cut>
>>>>> That specification requires that the function must always return a value
>>>>> (in the usual sense of the word for the programming language being used)
>>>>> and that that value accurately reflect whether the computation
>>>>> represented by the function call arguments is or is not a finite one.
>>>>> Not returning a value, in any situation or context, is not permissible.
>>>>> Every call must return, and it must return the correct true/false value.
>>>>
>>>> There is one invocation of Halts() in main() that is not infintely
>>>> recursive and does return a value to its caller.
>>>>
>>>> There is also an infinitely recursive invocation of Halts() from
>>>> H_Hat().
>>>
>>> Which is why Halts does not meet the specification for the function I
>>> asked for.
>>
>> To prove that your requirement is not simply jackass stupid please
>> provide one example of a function that return a result to it caller
>> when its caller invoked this function in infinte recursion.
>
> At least you now agree that your function does not meet the
> specification. Why did you post it? Did you not know it was a fail
> right from the start?
>
> The requirement that some function always return a value is a common
> one, but you can call it "jackass stupid" if you like. Your name for it
> is neither here nor there.
>
Then the standard C function: double sqrt(X) is <not>
a function because it can be called in infinite recursion, thus
preventing it from ever returning any value to its caller.
double Infinite_Recursion(double X)
{
Infinite_Recursion( sqrt(X) );
}
int main(int argc, char *argv[])
{
double X = Infinite_Recursion(1.0);
printf("%8.4f", X);
}
> If you want to have another go at meeting the specification I gave,
> remember that the function you post must return the correct value, for
> all arguments in all contexts. It can not conveniently not return when
> that suits your trickery.
>
--
Copyright 2020 Pete Olcott
"Great spirits have always encountered violent opposition from mediocre
minds." Einstein