The Static Semantics of the Green-Marl Graph Analysis Language: Formal Specification, Declarative Implementation and Integration with a Compiler Back-end