From Undecidability.Shared.Libs.PSL Require Import FinTypes Vectors.
From Undecidability.L Require Import Datatypes.Lists Tactics.LTactics Util.L_facts.
From Undecidability.TM  Require Import TM_facts ProgrammingTools .
From Undecidability.TM.L.CompilerBoolFuns Require Import Compiler_spec.
From Undecidability.TM Require Import Hoare.
Definition TM_bool_computable_hoare_in {k n Σ} s b (v: Vector.t (list bool) k): SpecV Σ (1+k+n)
:= ([Custom (eq niltape)] ++ Vector.map (fun bs => Custom (eq (encBoolsTM s b bs))) v) ++ Vector.const (Custom (eq niltape)) _.

Lemma nth_error_to_list {X n} (v : Vector.t X n) i k :
k = (proj1_sig (Fin.to_nat i)) ->
nth_error (Vector.to_list v) k = Some (Vector.nth v i).