Theory Language_Syntax
section "A Simple Imperative Language"
theory Language_Syntax imports Language_Prelims "Relative_Security.Trivia" begin
text ‹A Simple Imperative Language with arrays, inputs and outputs, and speculation fences, based off the syntax for IMP in Concrete Semantics \cite{Concrete}›
text ‹Scalar variables are defined as strings, and so are the array variables›
type_synonym vname = string
type_synonym avname = string
text ‹Since the Spectre benchmark examples reason about integer variables, we define our set of values to be integers›
type_synonym val = int
text ‹We define our set of locations to be integers›
type_synonym loc = nat
subsection "Arithmetic and Boolean Expressions"
text ‹Arithmetic expressions can either be literals, variables or array variables (array variable name, index), or some operation on these. The arithmetic operators we capture in an expression are addition and multiplication.
For boolean expressions we capture negation and conjunction, and the arithmetic comparison operator "less than" where equality of two arithmetic terms is later defined in terms of these constructors›