(* source language *)

Parameter string : Set.Inductive expr : Set :=
  | Lit : nat -> expr
  | Var : string -> expr
  | Plus : expr -> expr -> expr.Inductive expr : Set :=
  | Lit : nat -> expr
  | Var : string -> expr
  | Plus : expr -> expr -> expr.Inductive expr : Set :=
  | Lit : nat -> expr
  | Var : string -> expr
  | Plus : expr -> expr -> expr.Inductive expr : Set :=
  | Lit : nat -> expr
  | Var : string -> expr
  | Plus : expr -> expr -> expr.(* semantics of source language *)

Definition state := string -> nat.Fixpoint E (s : state) (e : expr) {struct e} : nat :=
  match e with
  | Lit n => n
  | Var v => s v
  | Plus e1 e2 => E s e1 + E s e2
  end.(* target language *)

Inductive instr : Set :=
  | LI : nat -> instr
  | LOAD : nat -> instr
  | STO : nat -> instr
  | ADD : nat -> instr.(* target language *)

Inductive instr : Set :=
  | LI : nat -> instr
  | LOAD : nat -> instr
  | STO : nat -> instr
  | ADD : nat -> instr.(* target language *)

Inductive instr : Set :=
  | LI : nat -> instr
  | LOAD : nat -> instr
  | STO : nat -> instr
  | ADD : nat -> instr.(* target language *)

Inductive instr : Set :=
  | LI : nat -> instr
  | LOAD : nat -> instr
  | STO : nat -> instr
  | ADD : nat -> instr.(* target language *)

Inductive instr : Set :=
  | LI : nat -> instr
  | LOAD : nat -> instr
  | STO : nat -> instr
  | ADD : nat -> instr.(* memory *)

Inductive cell : Set :=
  | Acc : cell
  | Reg : nat -> cell.(* memory *)

Inductive cell : Set :=
  | Acc : cell
  | Reg : nat -> cell.(* memory *)

Inductive cell : Set :=
  | Acc : cell
  | Reg : nat -> cell.Definition store := cell -> nat.

(* Specifications: *)
Lemma cell_eq_dec : forall c1 c2 : cell, {c1 = c2} + {c1 <> c2}.