1. 9
  1.  

  2. 2

    We can also map the + and * operators to versions operating on the abstract domain

    Does this count as a redundant mapping?

    1. 1

      Nope.

         {-} + {-} = {-}
         {-} * {-} = {+}
      
      1. 1

        Sorry, I meant this one:

        Imagine a mapping (abstraction mapping) from the integer … -3, -2, -1, 0, 1, 2, 3, … to the set {-, 0, +}. This is the abstract domain. Negatives to {-}, positives to {+} and 0 to {0}.

        1. 1

          Oh.

          Yes, it would. If you want to write a program that only operates on the ideas of positive, negative, and zero, then representing a positive state by any positive number is a terrible way to do it. Like checking for a non-zero exit code.

          1. 1

            I suspect that counts as mapping from the “Real World to abstract state.” I believe that because, in the quoted paragraphs, “this is the abstract domain” seems to refer to the {-, 0, +} set.

            My interpretation might be wrong! It’s weird to say integers are any more or less abstract concept than sign.

            I think the author says “abstract” because it’s the part that’s usually in our head; whereas the “concrete” part is usually in our code.

            I don’t see any difference in the ways of potentially mismapping from abstract to concrete than I do in the potential ways of potentially mismapping from the real world to abstract. Only that we explicitly choose to have missing states— that’s the point of simplifying abstractions!

      2. 2

        This has an interesting correspondence to one of my favorite software design talks of all time, by Daniel Jackson - Rethinking Software Design

        The main premise of the talk is that each concept in a codebase should be in 1:1 correspondence with a purpose, and he identifies the same mismatches between the two (“4 bad smells”, timestamped link).

        The purposes/concepts split is very similar to the abstract/concrete state split defined in the post, but it’s more general in that it doesn’t refer only to state.

        1. 3

          That’s a great talk, I’m watching it now. Thanks for the link!