Questions

  • What’s the difference between a type system and an abstract interpretation? When would you want to use one over the other?
  • Could you give an example of a type system that could prevent division-by-zero errors?
  • Say you have a language of integer expressions. Define the concrete and abstract domains for a sign analysis on this language.
    • in is given by a state value given to the concrete interpreter.
  • Draw the lattice for this abstract domain.
  • Write the abstraction and concretization functions for this abstract interpretation.
  • Describe the relationship between and ; what property must hold?
  • Define the abstract interpretation for this language for literals and in.
  • What should the abstract interpretation of the following expressions be?
  • State the soundness property with respect to and/or .
  • If the first expression resulted in , would this be sound?
  • If the second expression resulted in , would this be sound?
  • How could you use this analysis to tell if an expression will definitely divide by 0?
  • How could you use this analysis to tell if an expression may divide by 0?
  • Are there any cases where this analysis is not complete—i.e., it says there is a potential (“may”) divide by 0, but dividing by 0 is actually impossible?
  • How could you ameliorate this?

Board

Notes

  • Think aloud! Even if I’m lost, talking through my thinking is critical.
  • Partial evaluation: this is the term for anything where we partially evaluate a program at compile time.
    • This also includes algebraic reductions/term rewriting
    • Also includes constant function execution, etc.
    • This is the solution to the very last question
  • Soundness for Galois connections: ^ccq950
    • Given a concrete interpreter that takes expr and state , and given an abstract interpreter :
      • The actual concrete execution must be one possible outcome forecasted by our abstract interpretation.
    • Apparently this is something guaranteed with trace semantics, etc. too?
  • Type system pros/cons: type systems are modular
    • vs abstract interpretation which is whole program
  • Program optimization is the term for CFA, const prop, etc.
    • Abstract interpretation is a means to program optimization

Follow-ups

  • Look into trace semantics and all that—maybe one of Cousot’s papers ⏳ 2024-08-23 ✅ 2024-08-26