Concrete semantic of a toy imperative language

Here, I will define the semantic of the toy language we saw both in term of a transition system. Hence, we can apply the trace semantics we saw in the previous chapter to our toy language. I will also describe the semantics of this language in a denotational way.
We will see computable abstractions (which are, by the way, approximations) of these semantics (e.g., abstract semantics) in later files.
From AISAV Require Import Syntax.
From AISAV Require Import Utils.
From Stdlib Require Import Sets.Ensembles.

We will define semantic on set of values. But first, we need the user to provide operation per value, from which we can derive operations per set.
Module Type EvalExpr.
  Parameter D : Type.

  Parameter add : D → D → D.
  Parameter minus : D → D → D.
  Parameter mult : D → D → D.

End EvalExpr.

Module ConcreteExpr(E : EvalExpr with Definition D := Syntax.D).
Import Syntax.
Inductive aeval : aexp → (D → Prop) → Prop :=
  | E_ANum (n : D) (S : D → Prop) : S n → aeval (ANum n) S
  | E_APlus (a1 a2 : aexp) (S1 S2 : D → Prop):
      aeval a1 S1 → aeval a2 S2 →
        aeval
          (APlus a1 a2)
          (set_from_op E.add S1 S2)
  | E_AMinus (a1 a2 : aexp) (S1 S2 : D → Prop):
      aeval a1 S1 → aeval a2 S2 →
        aeval
          (AMinus a1 a2)
          (set_from_op E.minus S1 S2)
  | E_AMult (a1 a2 : aexp) (S1 S2 : D → Prop):
      aeval a1 S1 → aeval a2 S2 →
        aeval
          (AMult a1 a2)
          (set_from_op E.mult S1 S2)
.
End ConcreteExpr.