COMP.THEORY-------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 69 из 100
 От   : Richard Damon                       2:5075/128        26 авг 23 13:24:31
 К    : Charlie-Boo                                           26 авг 23 20:26:02
 Тема : Re: Simple Programming Problem but How Many Ways to Do It?
----------------------------------------------------------------------------------
                                                                                 
@MSGID: xMqa.162772@fx12.iad>
0701be96
@REPLY:
<865bc1f2-ae48-48cb-8140-4fb96fb33eeen@googlegroups.com> 32cbe7b6
@REPLYADDR Richard Damon
<Richard@Damon-Family.org>
@REPLYTO 2:5075/128 Richard Damon
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<865bc1f2-ae48-48cb-8140-4fb96fb33eeen@googlegroups.com>
@RFC-Message-ID:
xMqa.162772@fx12.iad>
@TZUTC: -0400
@PID: Mozilla Thunderbird
@TID: FIDOGATE-5.12-ge4e8b94
On 8/26/23 1:11 PM, Charlie-Boo wrote:
> Program 1 returns a Boolean value call it A.
> Program 2 returns a Boolean value call it B.
> We want one program that returns A ^ B (the value of A and B).
> We don`t want to call 1 and 2.
> We want to take the code in these two programs and create a new program.

> Assume we have the common commands and expression elements e.g. those of PHP.
> How many different programs can we create?

> C-B

A fundamental property of programming is that you can create an infinite 
variation of programs that achieve a given goal. At least as long as the 
requirements are written semantically (this is the result we need to 
generate) and not with syntactic limits (it must be written this way).

THough you have a syntactic restriction in your definition (we can`t 
"call" A or B, since you can always replace a call to a function with 
the code for that function, and you specified we have the code, we can 
use this property.

Now, the question comes down to terminology, if you have multipe ways of 
implementing a given algorithm, are they all "one program", or is each 
implementation consider a different program.

Normal terminology calls them diferent programs, so your answer is infinite.

There may be a finite (but large) practical limit established by the 
language you express the program in, and the machine it will be run on.
--- Mozilla Thunderbird
 * Origin: Forte - www.forteinc.com (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх