Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this presentation? Why not share!

- Brief tour of psp-std by Paul Phillips 1670 views
- Keynote, LambdaConf 2014 - The Sile... by Paul Phillips 5598 views
- Keynote, PNW Scala 2013 by Paul Phillips 40783 views
- A Scala Corrections Library by Paul Phillips 30488 views
- Naming Things and Finding Cothings by Paul Phillips 4256 views
- Keynote, LambdaConf 2015 - Ipecac f... by Paul Phillips 4135 views

1,418 views

Published on

Published in:
Software

License: CC Attribution License

No Downloads

Total views

1,418

On SlideShare

0

From Embeds

0

Number of Embeds

73

Shares

0

Downloads

8

Comments

0

Likes

2

No embeds

No notes for slide

- 1. Equality is Hard paul phillips lambdaconf 2016
- 2. Too hard. It's not even 10AM.
- 3. If A = B, does F[A] = F[B] ? • A ma&er of overriding interest to func4onal programmers • Subs4tu4on is the founda4on of equa4onal reasoning • Without subs4tu4on, we are lost
- 4. Boolean values in a nutshell
- 5. The meaning of a ques/on is the method of answering it. Tell me how you are searching, and I will tell you what you are searching for.
- 6. Two possible truth values? "Are you s*ll abusing animals?" "This statement is false." "The program will halt."
- 7. • I don't know. • I don't know yet. • I forgot. • Pre2y sure. • Doub7ul. • The ques<on is nonsense.
- 8. Category Theory in a nutshell
- 9. It depends on what the meaning of the word 'is' is.
- 10. Classical logic in a nutshell
- 11. Two truth values ought to be enough for anybody.
- 12. Nega%on: not without its problems Classical logic: p <=> !!p Intuitionist: p => !!p Paraconsistent: p <= !!p Intui&onist: even if p is not false, that doesn't make it true Paraconsistent: even if p is true, that doesn't mean it isn't false
- 13. Is nega(on inver(ble? • He's certainly a/rac0ve. • He's certainly una/rac0ve. • He's certainly not una/rac0ve...
- 14. Is nega(on inver(ble? • The boss has accepted my plan. • The boss has rejected my plan. • The boss has not rejected my plan.
- 15. Is nega(on inver(ble? • There is evidence he is at fault. • There is no evidence he is at fault. • There is no evidence he is not at fault.
- 16. I'm exploi+ng natural language. Maybe it's chea-ng. But what do Boolean values encode?
- 17. Taking the principle of excluded middle from the mathema5cian would be like proscribing the boxer the use of his ﬁsts.
- 18. Object-oriented equality in a nutshell
- 19. All instances are equal, but some instances are more equal than others.
- 20. Equality depends desperately on symmetry. Um. trait Any { def ==(x: Any): Bool def !=(x: Any): Bool = !(this == x) } trait AnyRef extends Any { def eq(x: AnyRef): Bool def ne(x: AnyRef): Bool = !(this eq x) }
- 21. Floa%ng point equality in a nutshell
- 22. The worst form of inequality is to try to make unequal things equal.
- 23. FP equality is ﬁsh in a barrel, sure. Why then is it s*ll to be found?
- 24. def s1(n: Int) = 0.1 * n def s2(n: Int) = Stream continually 0.1 take n reduceLeft (_ + _) def s3(n: Int) = BigDecimal("0." + n) 1 to 9 map (n => Seq( s1(n) == s2(n), s2(n) == s3(n), s3(n) == s1(n) ))
- 25. TTT TTT TFF TTT TTT FTF FTF FFT FFT
- 26. TTT TTT TFF TTT TTT FTF FTF FFT FFT
- 27. Booleans without totality in a nutshell
- 28. He said to his friend, "If the Bri2sh march By land or sea from the town to-night, Hang a lantern alo+ in the belfry arch Of the North Church tower as a signal light, Zero if by land, and one if by sea; And I on the opposite shore will be...
- 29. Overspeciﬁca+on in a nutshell
- 30. The diﬃculty in philosophy is to say no more than we know.
- 31. We habitually work with values which convey total certainty boiled down to a single bit. Is this the most robust approach?
- 32. A typical scala compiler method. def isMethodWithExtension = ( isMethod && owner.isDerivedValueClass && !isParamAccessor && !isConstructor && !hasFlag(SUPERACCESSOR) && !isMacro && !isSpecialized )
- 33. ex falso quodlibet in a nutshell
- 34. You get tragedy where the tree, instead of bending, breaks.
- 35. The principle of explosion Rejected by paraconsistent "inconsistency tolerant" logics
- 36. You can have it all True or False? Why stop at one?
- 37. Logic is a system for preserving some property across logical opera3ons. • Classical logic: truth • Intui0onist logic: jus'ﬁca'on • Probability logic: likelihood
- 38. Laws to consider repealing • Law of non-contradic/on: !(p && !p) "Contradictory statements cannot both be true." • Law of the excluded middle: p || !p "Either a proposi/on is true or its nega/on is true."
- 39. Ari$es of truthiness. _0 = Void // The void stares back at you _1 = Unit // Indifference logic _2 = Bool // You Are Here _3 = Opt[Bool] // billion dollar mistake? _4 = Bool x Bool // Is it true? Y/N Is it false? Y/N R = [0,1) // Fuzzy, possibility, probability logics
- 40. Setoids In a nutshell
- 41. Whereof one cannot speak, thereof one must be silent.
- 42. A setoid is a set equipped with an equivalence rela1on. A construc(ve setoid is equipped with an apartness rela1on.
- 43. Boolean Blindness To make use of a Boolean you have to know its provenance so that you can know what it means.
- 44. Haskell class Eq a where (==) :: a -> a -> Bool
- 45. I know, "performance" data Compared a = Equal a a | DisEqual a a | Incomparable class Eq a where (==) :: a -> a -> Compared a
- 46. Laws: do not confuse with fallacies
- 47. PhilosphyProgramming is a ba0le against the bewitchment of our intelligence by means of our language.
- 48. The purpose of abstrac/on is not to be vague, but to create a new seman/c level in which one can be absolutely precise.
- 49. The real founda-ons of his enquiry do not strike a man at all. Unless that fact has at some -me struck him.
- 50. [Wi$genstein] says every morning he begins his work with hope, and every evening he ends in despair.
- 51. If a lion could talk, we could not understand him.
- 52. If you want to learn more about the law of the excluded middle, take a voyage down to your public library. It's all in books!

No public clipboards found for this slide

Be the first to comment