1. 13
    1. 10

      Nice answer. My own short answer to “what are denotational semantics” is that it is like a compilation/translation pass, but the target is “maths” instead of a syntactic language. (By “maths”, in fact we choose some mathematical space and interpret programs as mathematical objects living in that space. Where “space” can mean just sets, something with more structure (for example a “domain”, a specific kind of ordered set), or nowadays a category with some structure.)

      The standard way to “test” a denotational semantics, to specify that it is correct, is to determine what relations between target mathematical objects corresponds to observational equivalence between source programs. (Sometimes two equivalent programs have denotations that are equal, sometimes we need to define an equivalence relation between denotations.) In particular, if two observationally-distinct programs have the same denotation, then the semantics is probably wrong.