(**************************************************************)
(*   Copyright Dominique Larchey-Wendling [*]                 *)
(*                                                            *)
(*                             [*] Affiliation LORIA -- CNRS  *)
(**************************************************************)
(*      This file is distributed under the terms of the       *)
(*         CeCILL v2 FREE SOFTWARE LICENSE AGREEMENT          *)
(**************************************************************)
From Undecidability.Shared.Libs.DLW.Utils
From Undecidability.Shared.Libs.DLW.Vec
From Undecidability.MuRec
From Undecidability.DiophantineConstraints
Set Implicit Arguments.
Local Notation "'⟦' f '⟧'" := (@ra_rel _ f) (at level 0).
Definition h10c_nat (c : h10c) :=
match c with
| h10c_one x      => recomp 0 x
| h10c_plus x y z => recomp 1 (recomp z (recomp x y))
| h10c_mult x y z => recomp 2 (recomp z (recomp x y))
end.
Definition nat_h10c (n : nat) :=
match decomp_l n with
| 0 => h10c_one (decomp_r n)
| 1 => h10c_plus (decomp_l (decomp_r (decomp_r n)))
(decomp_r (decomp_r (decomp_r n)))
(decomp_l (decomp_r n))
| _ => h10c_mult (decomp_l (decomp_r (decomp_r n)))
(decomp_r (decomp_r (decomp_r n)))
(decomp_l (decomp_r n))
end.

Lemma nat_h10c_nat c : nat_h10c (h10c_nat c) = c.