Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Difference between If[] and Implies[]' topicStudent Support Forum > General > Archives > "Difference between If[] and Implies[]"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
10/26/12 7:00pm

"If" is a programming construct.
Implies is a boolean logic construct.

Examples from the help pages:

In[1]:= If[True,a]
Out[1]= a

In[2]:= If[False,a]
<<<nothing>>>

In[3]:= Implies[True,a]
Out[3]= a

In[4]:= Implies[False,a]
Out[4]= True

If does not treat all its arguments as booleans and return a boolean, it is meant to use mostly for control flow in programming.

Implies was introduced much later to try to provide the pieces to calculate with logic.

Programming languages have a nasty habit of grabbing words from human languages, twisting the meaning to be something similar, but different, and then using them. If the meaning were twisted into something totally different it might be less likely to be misinterpreted.

URL: ,

Subject (listing for 'Difference between If[] and Implies[]')
Author Date Posted
Difference between If[] and Implies[] LogicProgram... 10/26/12 4:41pm
Re: Difference between If[] and Implies[] Bill Simpson 10/26/12 7:00pm
< Previous CommentHelp | Reply To Comment | Reply To Topic