From Undecidability.L Require Export L Encodings Interpreter Choose.
(** * Results obtained with self-interpreters *)
(** ** Step-indexed self-interpreter *)
(** *** Encoding of options *)
Definition none : term := .\"s", "n"; "n".
Definition some : term := .\"t", "s", "n"; "s" "t".
Hint Unfold some none : cbv.
Definition oenc t :=
match t with
| Some t => lambda(lambda (1 (tenc t)))
| None => none
end.

Lemma some_correct_r s t t' : proc t -> proc t' -> oenc (Some s) t t' ≡ t (tenc s).