Peter Norvig's book+site is a very good learning tool. by the way: if you are using OSX or Linux and have your terminal using a font with decent unicode coverage, `\Rightarrow` followed by TAB turns into `⇒`, which is the generally accepted symbol for material implication.
⇒(p::Bool, q::Bool) = ifelse(p, q, true) true ⇒ true, false ⇒ true, false ⇒ false # (true, true, true) true ⇒ false # false On Thursday, October 6, 2016 at 4:34:11 PM UTC-4, Kevin Liu wrote: > > Thanks for the distinction, Jeffrey. > > Also, look what I found https://github.com/aimacode. Julia is empty :-). > Can we hire some Martians to fill it up as we have ran out of Julians on > Earth? I'm happy I found this though. > > On Thursday, October 6, 2016 at 5:26:43 PM UTC-3, Jeffrey Sarnoff wrote: >> >> you are welcome to use >> implies(p::Bool, q::Bool) = !p | q >> { !p, ~p likely compile to the same instructions -- they do for me; you >> might prefer to use of !p here as that means 'logical_not(p)' where ~p >> means 'flip_the_bits_of(p)' } >> >> I find that this form is also 40% slower than the ifelse form. >> >> >> >> On Thursday, October 6, 2016 at 4:11:55 PM UTC-4, Kevin Liu wrote: >>> >>> Is this why I couldn't find implication in Julia? >>> >>> Maybe it was considered redundant because (1) it is less primitive than >>>> "^", "v", "~", (2) it saves very little typing since "A => B" is >>>> equivalent >>>> to "~A v B". – Giorgio >>>> <http://programmers.stackexchange.com/users/29020/giorgio> Jan 18 '13 >>>> at 14:50 >>>> <http://programmers.stackexchange.com/questions/184089/why-dont-languages-include-implication-as-a-logical-operator#comment353607_184089> >>> >>> >>> Wikipedia also says the implication table is identical to that of ~p | >>> q. So instead just the below? >>> >>> julia> ~p | q >>> >>> false >>> >>> >>> I'll take that. >>> >>> On Thursday, October 6, 2016 at 4:08:00 PM UTC-3, Jeffrey Sarnoff wrote: >>>> >>>> (the version using ifelse benchmarks faster on my system) >>>> >>>> On Thursday, October 6, 2016 at 3:05:50 PM UTC-4, Jeffrey Sarnoff wrote: >>>>> >>>>> here are two ways >>>>> >>>>> implies(p::Bool, q::Bool) = !(p & !q) >>>>> >>>>> implies(p::Bool, q::Bool) = ifelse(p, q, true) >>>>> >>>>> >>>>> >>>>> >>>>> On Thursday, October 6, 2016 at 12:10:51 PM UTC-4, Kevin Liu wrote: >>>>>> >>>>>> How is an implication represented in Julia? >>>>>> >>>>>> >>>>>> https://en.wikipedia.org/wiki/Material_conditional#Definitions_of_the_material_conditional >>>>>> >>>>>
