Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Assigning Meanings to Programs

Jade Allen
August 23, 2016

Assigning Meanings to Programs

In 1967 Robert Floyd (who later won an ACM Turing Award) explained how logical propositions could be used to assert useful properties of programs without the need to use a computer or a specific programming language.

Jade Allen

August 23, 2016
Tweet

More Decks by Jade Allen

Other Decks in Technology

Transcript

  1. • ACM Turing Award 1978 • Completely self-taught (worked as

    a computer operator during the night shift) • Never earned a PhD • BS 1953 (aged 17) • Wrote one of the first ALGOL compilers • Primary pre-publication reviewer of Knuth’s The Art of Computer Programming Assigning Meanings to Programs | @bytemeorg
  2. “The state of the art of computer programming was recently

    referred to by Robert Balzer in these words: It is well known that software is in a depressed state. It is unreliable, delivered late, unresponsive to change, inefficient, and expensive. Furthermore, since it is currently labor intensive, the situation will further deteriorate as demand increases and labor costs rise. If this sounds like the famous "software crisis" of a decade or so ago, the fact that we have been in the same state for ten or fifteen years suggests that "software depression" is a more apt term.” Assigning Meanings to Programs | @bytemeorg
  3. The older schools gradually disappear. In part their disappearance is

    caused by their members' conversion to the new paradigm. But there are always some men who cling to one or another of the older views, and they are simply read out of the profession, which thereafter ignores their work. Thomas S. Kuhn In computing, there is no mechanism for reading such men out of the profession. I suspect they mainly become managers of software development…I believe the best chance we have to improve the general practice of programming is to attend to our paradigms. Assigning Meanings to Programs | @bytemeorg
  4. “…The proposal that the semantics of a programming language may

    be defined independently of all processors for that language, by establishing standards of rigor for proofs about programs in the language appear to be novel...” Assigning Meanings to Programs | @bytemeorg
  5. n = 10 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) Assigning Meanings to Programs | @bytemeorg
  6. n = 3 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) Assigning Meanings to Programs | @bytemeorg
  7. n = 3 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) State: n = 3 i = 1 S = 0 Assigning Meanings to Programs | @bytemeorg
  8. n = 3 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) State: n = 3 i = 1 S = 1 Assigning Meanings to Programs | @bytemeorg
  9. n = 3 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) State: n = 3 i = 2 S = 1 Assigning Meanings to Programs | @bytemeorg
  10. n = 3 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) State: n = 3 i = 2 S = 1 Assigning Meanings to Programs | @bytemeorg
  11. n = 3 i = 1 S = 0 while

    i <= n: S = S + i i = i + 1 print "S is {0}".format(S) State: n = 3 i = 4 S = 6 Eventually… Assigning Meanings to Programs | @bytemeorg
  12. § Assign 1st order logical predicates to edges in a

    graph of computation. § These logical predicates define the state the computer must be in. § The logic statements have a 1:1 correspondence with programming language statements. § In Assigning Meanings to Programs Floyd defines logical statements for an abstract flowchart “language” and for certain ALGOL60 instructions. § Also defined logical predicates for “start” and “termination.” Assigning Meanings to Programs | @bytemeorg
  13. §Assert correctness: an execution solves a given problem correctly. §Assert

    invariants: a program has certain properties which are never violated during its execution. §Assert equivalence: one program and another program are the same program. (Thus any invariants also hold.) §Assert termination: computation will end. Assigning Meanings to Programs | @bytemeorg
  14. §Using logical statements lets us abstract computation away from specific

    language and computer implementations. §Using logical statements lets us assert various useful properties of a program. §Visualization and code (AST) analysis are powerful techniques to understand how code behaves. §Historical papers are dope! Assigning Meanings to Programs | @bytemeorg
  15. § https://en.wikipedia.org/wiki/Robert_W._Floyd § Robert Floyd obituary, http://news.stanford.edu/news/2001/november7/floydobit-117.html § Assigning Meaning

    to Programs, https://www.cs.virginia.edu/~weimer/2007-615/reading/FloydMeaning.pdf § The paradigms of programming (1978 Turing Award Lecture), http://dl.acm.org/ft_gateway.cfm?id=359140 § http://paperswelove.org § http://pythontutor.com § http://tlaplus.net § http://code.activestate.com/recipes/213898/ § https://github.com/HewlettPackard/gas Assigning Meanings to Programs | @bytemeorg