Re: If-then in Logic vs Programming

From: R-matrix (random_at_matrix.mx)
Date: 03/16/05


Date: Wed, 16 Mar 2005 12:56:20 -0500

David C. Ullrich <ullrich@math.okstate.edu> wrote:

>> I've often heard professors and others say logic underlies computer
>>programming (and that certainly seems to be true to some extent),
>
>Of course that's true!
>
>>so
>>your response and others here are news to me.
>
>Huh? Saying that logic underlies computer programming doesn't
>imply that "if-then" in logic means exactly the same thing
>as "if-then" in a typical programming language.

 If someone says "Logic underlies my statements" and then goes on to
say "If ..., then..." it would be reasonable to expect the statement
to adhere to logical standards (classic in this case) for the if-then.

 But it's academic since it seems that George and Acme have both
shown, contrary to your assertions, that the if-then of classic logic
still exists in programming:

http://groups-beta.google.com/group/sci.logic/msg/603d29edb209ec95
http://groups-beta.google.com/group/sci.logic/msg/ad0baa3d67466e66

>> That comports with my observation of the difference but adds the
>>critical distinction between statements and commands, which you say
>>explains the difference, and I see your points, thanks! Can you
>>elaborate further? Like give examples of statements vs commands?
>
>We should note that one problem here is that the word "statement"
>is often used in programming to refer to things that are not
>statements at all, in the sense the word's usually used (and
>in the sense in which I'm using it here):
>
>print 'Hello World'
>
>is often called a "print statement" in programming, while in
>the sense we're using the words here it's a command, not a
>statement.
>
>here's an example of a statement: I find it hard to believe that
>you're having trouble with the difference between statements and
>commands.

 One should not assume that the colloquial meaning of a term x
naturally translates to the use of term x within a formal system.

>
>here's an example of a command: don't assume that specific phrases
>like "if-then" mean the same thing in logic and in programming,
>just because they have similar spellings.

 And don't assume that the colloquial meaning of "statement" and
"command" translate perfectly to their meaning in a formal system.



Relevant Pages

  • Re: Wordsearch:AI Insanity
    ... bios, what with being hard-coded and all. ... Stop with an error message. ... an undefined command or something, so what happens depends entirely on ... So it's programmed to alter its own programming depending on input? ...
    (rec.arts.sf.composition)
  • Re: Great SWT Program
    ... And, of course, none of the nasty things that you have said or implied ... such rot and squeezing out Java programming related traffic with emacs ... I didn't claim that they could not learn a load of programming skills ... bit is the entire command but is only part of the full command line, ...
    (comp.lang.java.programmer)
  • Re: Great SWT Program
    ... such rot and squeezing out Java programming related traffic with emacs ... I didn't claim that they could not learn a load of programming skills ... CLI skills are hardly "much of the skillset of programming" - but I ... bit is the entire command but is only part of the full command line, ...
    (comp.lang.java.programmer)
  • Re: Overflowing a Long
    ... Maybe you had to "grow up" on a command line to appreciate the clarity ... strictly in terms of 3GLs or even machine language. ... I would guess that you probably started programming even earlier ... and thus you're more deeply entrenched in the programming style ...
    (microsoft.public.vb.general.discussion)
  • Re: dynamic menus
    ... I'm new at Windows ... programming, so I keep getting tripped up by little things like this. ... > Most likely your objectMenu is going out of scope and being destroyed. ... > Each command ID generated by the menu items must be unique. ...
    (microsoft.public.vc.mfc)