[comp.lang.c] what "cast" means

msb@sq.UUCP (07/09/87)

> I withdraw!  I recant!  assignment-produces-an-implicit-cast, ...

No, assignment produces an implicit *conversion*.  "Conversion" is the
general term for making a value of one type into a different type.
"Cast" refers specifically to the syntactic device "(type) expression".
For example, in the statements

	int i; i = (int) 2.3;

the *cast* is redundant because the *conversion* of 2.3 to int woul;d
occur implicitly if the cast was omitted.

C terminology is confusing enough when used carelessly as it is;
let's try and keep this one straight.

Mark Brader		"Not looking like Pascal is not a language deficiency!"
utzoo!sq!msb							  -- Doug Gwyn

dg@wrs.UUCP (David Goodenough) (07/14/87)

In article <1987Jul9.162103.1701@sq.uucp> msb@sq.UUCP (Mark Brader) writes:
> ... lots deleted
>
>Mark Brader		"Not looking like Pascal is not a language deficiency!"
>utzoo!sq!msb							  -- Doug Gwyn

does this mean that "looking like Pascal is a language deficiency!" :-)
--
		dg@wrs.UUCP - David Goodenough

					+---+
					| +-+-+
					+-+-+ |
					  +---+

beattie@netxcom.UUCP (Brian Beattie) (07/16/87)

In article <243@wrs.UUCP> dg@wrs.UUCP (David Goodenough) writes:
>In article <1987Jul9.162103.1701@sq.uucp> msb@sq.UUCP (Mark Brader) writes:
>> ... lots deleted
>>
>>Mark Brader		"Not looking like Pascal is not a language deficiency!"
>>utzoo!sq!msb							  -- Doug Gwyn
>
>does this mean that "looking like Pascal is a language deficiency!" :-)
I think that such a position would be defensible
>--
>		dg@wrs.UUCP - David Goodenough
>
>					+---+
>					| +-+-+
>					+-+-+ |
>					  +---+


-- 
-----------------------------------------------------------------------
Brian Beattie			| Phone: (703)749-2365
NetExpress Communications, Inc.	| uucp: seismo!sundc!netxcom!beattie
1953 Gallows Road, Suite 300	|
Vienna,VA 22180			|

rwhite@nu3b2.UUCP (Robert C. White Jr.) (07/17/87)

In article <243@wrs.UUCP>, dg@wrs.UUCP (David Goodenough) writes:
> In article <1987Jul9.162103.1701@sq.uucp> msb@sq.UUCP (Mark Brader) writes:
> > ... lots deleted
> >
> >Mark Brader		"Not looking like Pascal is not a language deficiency!"
> >utzoo!sq!msb							  -- Doug Gwyn
> 
> does this mean that "looking like Pascal is a language deficiency!" :-)
> --

You ever bother to learn logic? :-/


Robert.

Disclaimer:  My mind is so fragmented by random excursions into a
	wilderness of abstractions and incipient ideas that the
	practical purposes of the moment are often submerged in
	my consciousness and I don't know what I'm doing.
		[my employers certainly have no idea]

okunewck@psuvax1.psu.edu (Philip E. OKunewick) (08/06/87)

In article <243@wrs.UUCP> dg@wrs.UUCP (David Goodenough) writes:
>In article <1987Jul9.162103.1701@sq.uucp> msb@sq.UUCP (Mark Brader) writes:
>>Mark Brader		"Not looking like Pascal is not a language deficiency!"
>>utzoo!sq!msb							  -- Doug Gwyn
>
>does this mean that "looking like Pascal is a language deficiency!" :-)
>		dg@wrs.UUCP - David Goodenough

No.

We can simplify this into a mathematical proof:
(  ! = logical not;  ] = logical implication;  ^ = logical or  )

We have two basic postulates here:
1: (looking like pascal)  (l.l.p)
2: (a language deficiency)  (a l.d.)

The first statement can be written as:
!(!(looking like pascal) ] (a language deficency))
The second statement can be written as:
(looking like pascal) ] (a language deficency)
Putting it together, we get:
!((!(l.l.p.) ] (a l.d.))  ]  ((l.l.p.) ] (a l.d.))
Now, if this is the case, then we should expect:
( !(!(l.l.p.) ] (a l.d.))  ]  ((l.l.p.) ] (a l.d.)) ) = 1
replace the implication thusly: ( A ] B  =  !A ^ B )
					 (do a truth table - it works.)
(  !( !(!(l.l.p.)) ^ (a l.d.) )  ^  (!(l.l.p.) ^ (a l.d.))  ) = 1
get rid of the double negation there...
(  !( (l.l.p.) ^ (a l.d.) )  ^  (!(l.l.p.) ^ (a l.d.))  ) = 1
Now we're ready to boogie.  If the implication were correct, then we
should get a true result in 4 cases:
1: Neither looks like pascal, nor is deficient
(l.l.p. = 0, a l.d. = 0)    (  !( (0) ^ (0) )  ^  (!(0) ^ (0))  )  =  1
2: Doesn't look like pascal, but is deficient
(l.l.p. = 0, a l.d. = 1)    (  !( (0) ^ (1) )  ^  (!(0) ^ (1))  )  =  1
3: Looks like pascal but is not deficient
(l.l.p. = 1, a l.d. = 0)    (  !( (1) ^ (0) )  ^  (!(1) ^ (0))  )  =  1
4: Looks like pascal and is deficient too
(l.l.p. = 1, a l.d. = 1)    (  !( (1) ^ (1) )  ^  (!(1) ^ (1))  )  =  1
Simply each case:
1: ( !(0^0) ^ (1^0) ) = 1   (1^1) = 1  TRUE
2: ( !(0^1) ^ (1^1) ) = 1   (0^1) = 1  TRUE
3: ( !(1^0) ^ (0^0) ) = 1   (0^0) = 1  FALSE
4: ( !(1^1) ^ (0^1) ) = 1   (0^1) = 1  TRUE

So, as anybody can clearly see, one can not deduce "looking like Pascal
is a language deficiency," from the postulate "Not looking like Pascal is
not a language deficiency".

However, by the same logic, just because a language looks like Pascal
does not mean that it has major deficiencies.

Didja ever try to hack in PL/I?

						---Duck


P.S.  Fun things to tell all your friends:

A   B   !A   A ] B   !A ^ B
0   0    1     1        1
1   0    0     0        0
0   1    1     1        1
1   1    0     1        1

uccjcm@ecsvax.UUCP (Jonathon C. McLendon IV) (08/08/87)

In article <2817@psuvax1.psu.edu>, okunewck@psuvax1.psu.edu (Philip E. OKunewick) writes:
> In article <243@wrs.UUCP> dg@wrs.UUCP (David Goodenough) writes:
> >In article <1987Jul9.162103.1701@sq.uucp> msb@sq.UUCP (Mark Brader) writes:
> >>Mark Brader		"Not looking like Pascal is not a language deficiency!"
> >>utzoo!sq!msb							  -- Doug Gwyn
> >
> >does this mean that "looking like Pascal is a language deficiency!" :-)
> >		dg@wrs.UUCP - David Goodenough
> 
> No.
>
> We can simplify this into a mathematical proof:
Really?

> (  ! = logical not;  ] = logical implication;  ^ = logical or  )
> 
> We have two basic postulates here:
> 1: (looking like pascal)  (l.l.p)
> 2: (a language deficiency)  (a l.d.)
> 
> The first statement can be written as:
> !(!(looking like pascal) ] (a language deficency))

This is wrong! This statement can be simplified to:

  (looking like pascal) ] !(a language deficiency)

 which is clearly NOT the first statement.

What you really want as the first statement is:

 !(looking like pascal) ] !(a language deficiency)

In general, !X ] !Y does not imply X ] Y.

Or in your notation (!X ] !Y) !] (X ] Y) which simplifies to...

(!X ] !Y) ] !(X ] Y)  
(!X ] !Y) ] (!X ] !Y)

Now, is this not correct?   We give you a 'D' for effort though.
Your proof was correct though, it was just the supposition that....
-- 
Signed:
            Jonathon C. McLendon IV    -> ecsvax!uccjcm (919) 962-3228
            My employer has no opinions that aren't my own...
               (Or is it the other way around?)

throopw@xyzzy.UUCP (Wayne A. Throop) (08/10/87)

> uccjcm@ecsvax.UUCP (Jonathon C. McLendon IV)
>> okunewck@psuvax1.psu.edu (Philip E. OKunewick)

>>>> [not looking like Pascal is not a language deficiency]
>>>does this mean that "looking like Pascal is a language deficiency!" :-)

>> (  ! = logical not;  ] = logical implication;  ^ = logical or  )
>> We have two basic postulates here:
>> 1: (looking like pascal)  (l.l.p)
>> 2: (a language deficiency)  (a l.d.)
>> The first statement can be written as:
>> !(!(looking like pascal) ] (a language deficency))
> This is wrong! This statement can be simplified to:
>   (looking like pascal) ] !(a language deficiency)

Actually, Philip is correct and Jonathon is quite wrong.  Reading "is
not" as "does not imply" as Philip does makes far more sense than
reading "is not" as "implies the negation of" as Jonathon does.  Or to
put it another way, using a simple prefix notation,
(not (implies (not A) B)) cannot be simplified to (implies A (not B)) as
Jonathon seems to think.  Or does Jonathon really think that "it is not
the case that Fred not being a poor driver implies Fred will have an
accident" is equivalent to "Fred being a poor driver implies Fred will
not have an accident"?

In particular, (not (implies (not A) B)) reduces to (and (not A) (not B)),
while (implies A (not B)) reduces to (or (not A) B).

Of course both Philip and Jonathan translate the original two claims
into somewhat more formal terms incorrectly.  More correctly, the two
claims "not looking like Pascal is not a language deficiency" and
"looking like Pascal is a language deficiency" reduce to

        (not (forall l (implies (not (pascallike l) (deficient l)))))
and
        (forall l (implies (pascallike l) (deficient l)))

respectively, and the two are not equivalent.  Reducing these claims,
the first one becomes
        (exists l (not (implies (not (pascalllike l) (deficient l)))))
which becomes
        (exists l (and (not (pascalllike l)) (not (deficient l))))

Whereas the second becomes
        (forall l (or (not (pascallike l)) (deficient l)))
or perhaps
        (not (exists l (and (pascallike l) (not (deficient l)))))

The two claims are, therefore not equivalent.  And further, the first
does not imply the second.

--
"What does self-denial mean to you, Roderick?"
"Gee Father, I don't know, is it like the cretin who says all cretins
 are liars?"
                                --- from "Roderick" by John Sladek
-- 
Wayne Throop      <the-known-world>!mcnc!rti!xyzzy!throopw

stuart@bms-at.UUCP (Stuart D. Gathman) (08/11/87)

In article <3671@ecsvax.UUCP>, uccjcm@ecsvax.UUCP (Jonathon C. McLendon IV) writes:

> In article <2817@psuvax1.psu.edu>, okunewck@psuvax1.psu.edu (Philip E. OKunewick) writes:

> > (  ! = logical not;  ] = logical implication;  ^ = logical or  )

> > The first statement can be written as:
> > !(!(looking like pascal) ] (a language deficency))

> This is wrong! This statement can be simplified to:
>   (looking like pascal) ] !(a language deficiency)
>  which is clearly NOT the first statement.
> What you really want as the first statement is:

>  !(looking like pascal) ] !(a language deficiency)

Look carefully at the parenthesis.  The original poster is correct.

!(!(looking like pascal) ] (a language deficency))
^ ^
| |
| +----- negates "looking like pascal"
+------- negates the ']' operator: "is" -> "is not"
-- 
Stuart D. Gathman	<stuart@bms-at.uucp>
			<..!{vrdxhq|dgis}!bms-at!stuart>

uccjcm@ecsvax.UUCP (Jonathon C. McLendon IV) (08/12/87)

In article <190@xyzzy.UUCP>, throopw@xyzzy.UUCP (Wayne A. Throop) writes:
> > uccjcm@ecsvax.UUCP (Jonathon C. McLendon IV)
> >> okunewck@psuvax1.psu.edu (Philip E. OKunewick)
> 
> >>>> [not looking like Pascal is not a language deficiency]
> >>>does this mean that "looking like Pascal is a language deficiency!" :-)
> 
> Actually, Philip is correct and Jonathon is quite wrong.

Correct, I was wrong. I attribute this to a minor phase transformation
when materializing during deceleration to sub-light speed.

> 
> In particular, (not (implies (not A) B)) reduces to (and (not A) (not B)),
> while (implies A (not B)) reduces to (or (not A) B).
> 
> Reducing these claims, the first one becomes
>         (exists l (not (implies (not (pascalllike l) (deficient l)))))
> which becomes
>         (exists l (and (not (pascalllike l)) (not (deficient l))))

        Neither of these is reduced, therefore, their non-equivalence
        proves nothing.

There is a much simpler way to do this, and without all the parenthesis.

I. Assume A implies B, then not B implies not A follows directly.
   The contra-positive of this [Assume not B implies not A...] also
   follows directly.

Apply the contra-positive to the statement "Not looking like Pascal implies
not a language deficiency." One obtains "A language deficiency implies
looking like Pascal" which is not "Looking like Pascal implies a language
deficiency." These are the proper reduced statements, and they are not 
equivalent.
QED
        (Note that the "implies" above are one-way, that is, they are not
         "if and only if.")


Now, this is really not a proper subject for comp.lang.c, so I will have
no further responses. All flamage, slammage, damage to /dev/null please.
-- 
Signed:
            Jonathon C. McLendon IV    -> ecsvax!uccjcm (919) 962-3228
            My employer has no opinions that aren't my own...
               (Or is it the other way around?)

gwyn@brl-smoke.ARPA (Doug Gwyn ) (08/13/87)

Re: not looking like Pascal is not a language deficiency

As originator of the original statement, I would like to thank
everyone for demonstrating how ridiculous a naive application
of propositional calculus can be.  The fact is, my statement
does not lend itself to accurate, useful rendition in such terms.
In fact, it is conveying multiple meanings simultaneously --
it is a refutation of the putative claim that "not looking like
Pascal IS a language deficiency"; it also is saying something
about what not-looking-like-Pascal signifies (or doesn't
signify):
	not-looking-like-Pascal is-not a-language-deficiency
All these attempts to formalize it lose at least some of its
meaning, which involves more than mere syntactic form.

dg@wrs.UUCP (David Goodenough) (08/17/87)

In article <6281@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>Re: not looking like Pascal is not a language deficiency
>
>As originator of the original statement, I would like to thank
>everyone for demonstrating how ridiculous a naive application
>of propositional calculus can be. .....

And as the other half of the impromptu team that spawned this somewhat
silly discussion, I was hoping that people would have noticed that my
original comment was:

Does this mean that looking like Pascal is a language deficiency? :-)

								  ^^^
								  ^^^
								  ^^^
								  ^^^
								  ^^^

Now when I read the nettiquette document it said that anything with a
smiley face IS NOT TO BE TAKEN SERIOUSLY. As I have reiterated at least
three times I am aware that my question is obviously incorrect in its
assumption that A => B if and only if !A => !B. So can we lay this to
rest in peace.

	PLEASE net people??? We've got better things to discuss
--
		dg@wrs.UUCP - David Goodenough

					+---+
					| +-+-+
					+-+-+ |
					  +---+