1. In the type rule for assignments, the result type is chosen to be that of the lvalue. Alternatively, the result type could have been chosen to be that of the expression. Show that these two variations permit different programs.

    Assign.java

  2. Construct a type proof showing that the following program is statically type correct:
    {A x; {B y; x=y.foo(y);}}
    
    in an environment with these classes:
    class A {
      public A foo(A a) {...}
    }
    
    class B extends A {
      public A foo(B b) {...}
    }
    
    using the Joos 1 type rule for methods.

    type proof

  3. An intermediate type rule for method overloading is the following: It is permitted to match formal and actual argument types using assignment compatibility, but this must only be possible for a single method. Phrase the corresponding formal type rule.

    type rule