/machines/1RB0RA_1RC0RD_1RD0LC_1LE1RA_---1LF_1RB0LC/rocq/hdr.v · raw
From BusyCoq Require Import Individual62.
Require Import Lia.
Require Import ZArith.
Require Import String.
From BusyCoq Require Import Inductive.
From BusyCoq Require Import UnaryCounter.

Module Inductive62 := Inductive BB62.
Import Inductive62.

Lemma progress_rw tm c1 c2:
  progress tm c1 c2 <->
  Compute.TM.progress tm c1 c2.
Proof.
  split; intro H.
  - induction H.
    + constructor.
      destruct H; auto.
    + eapply Compute.TM.progress_step; eauto.
      destruct H; auto.
  - induction H.
    + constructor.
      destruct H; auto.
    + eapply progress_step; eauto.
      destruct H; auto.
Qed.

Ltac solve_hlin_nonhalt_T cfg T :=
  apply (decide_hlin_nonhalt_spec cfg T);
  [ unfold Config_WF; cbn;
    repeat rewrite List.Forall_cons_iff;
    repeat rewrite List.Forall_nil_iff;
    cbn;
    repeat split;
    intros;
    unfold s0;
    rewrite progress_rw;
    try (es; fail)
  | native_cast_no_check (eq_refl true)].

Ltac solve_hlin_nonhalt cfg :=
  match goal with
  | |- ~halts (TM_from_str ?x) c0 =>
    idtac x;
    (solve_hlin_nonhalt_T cfg 1000000%N)
  end.