Com S 641 meeting -*- Outline -*- * the correspondence principle (3.7) ** in negation ------------------------------------------ THE ANTI-CORRESPONDENCE PRINCIPLE You can make your language - harder to learn, and - less regular if the semantics of binding identifiers is Example: use lazy evaluation for functions, eager evaluation for exp parameters var a: newint; fun f = @a+1; proc p(x:int exp) = (a:=x+f; a:=x+f); in a := 0; call p(f) Counter-examples: ------------------------------------------ ... different for abstraction forms and parameterization forms Q: Can you tell from the form of x and f what kind of evaluation is used? no Q: How could that be fixed? use f() to call f, effectively making all functions parameterized use f as the value of the function itself. ... have const declarations, but not const parameters Also: Fortran IV had call-by-reference, but not reference decls ... Scheme: eager expression parameters, binding of names is eager C++: reference parameters of the form int & x and declarations of the same form! eager evaluation otherwise for both Haskell: lazy evaluation for both parameters and declarations ** disproof of correspondence (3.7.1) ------------------------------------------ PROVING LACK OF CORRESPONDENCE Example: expression parameters to procedures. Must show: for some e, s, E, I1, I2, C, such that I1 not in ({I2} U FV(E)) [[fun I2 = E in C]] e s =/= [[proc I1(I2) = C in call I1(E)]] e s ------------------------------------------ strategy, simplify both sides