Overall goals of Program Verification While automatic program verification is a long range goal … Which might be restricted to applications where the extra cost is justified should try to design programming languages that help, rather than hinder, our ability to make progress in this area. continue research on the semantics of programming languages continue research the ability to prove program correctness Describing a Language #2 - Static Semantics Static semantics covers some language features difficult or impossible to handle in a BNF/CFG a mechanism for building a parser that produces an abstract syntax It’s also tree of its input are one common technique just Categories attribute grammars can handle Context-free but cumbersome (e.g., type checking) Non-context-free (e.g., variables must be declared before they are used) Parse tree vs. abstract syntax tree Parse trees follow a grammar and usually have many nodes that are artifacts of how the grammar was written An (AST) eliminates useless structural nodes It uses nodes corresponding to constructs in the programming language and is easier to interpret or generate code from it Parse tree vs. abstract syntax tree (1 + 2 + 3)
Overall goals of Program Verification While automatic program verification is a long range goal … Which might be restricted to applications where the extra cost is justified should try to design programming languages that help, rather than hinder, our ability to make progress in this area. continue research on the semantics of programming languages continue research the ability to prove program correctness Describing a Language #2 - Static Semantics Static semantics covers some language features difficult or impossible to handle in a BNF/CFG It’s also a mechanism for building a parser that produces an abstract syntax tree of its input are just one common technique Categories attribute grammars can handle Context-free but cumbersome (e.g., type checking) Non-context-free (e.g., variables must be declared before they are used) Parse tree vs. abstract syntax tree Parse trees follow a grammar and usually have many nodes that are artifacts of how the grammar was written An (AST) eliminates useless structural nodes It uses nodes corresponding to constructs in the programming language and is easier to interpret or generate code from it Parse tree vs. abstract syntax tree (1 + 2 + 3)