Guest User

Terms are Well-Founded.

a guest
Aug 29th, 2018
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. (* PUBLIC DOMAIN *)
  2. Require Export Coq.Vectors.Vector.
  3. Require Export Coq.Lists.List.
  4. Require Import Bool.Bool.
  5. Require Import Logic.FunctionalExtensionality.
  6. Require Import Coq.Program.Wf.
  7.  
  8. Definition SetVars := nat.
  9. Definition FuncSymb := nat.
  10. Definition PredSymb := nat.
  11. Record FSV := {
  12. fs : FuncSymb;
  13. fsv : nat;
  14. }.
  15. Record PSV := MPSV{
  16. ps : PredSymb;
  17. psv : nat;
  18. }.
  19. Inductive Terms : Type :=
  20. | FVC :> SetVars -> Terms
  21. | FSC (f:FSV) : (Vector.t Terms (fsv f)) -> Terms.
  22.  
  23. Definition rela : forall (x y:Terms), Prop.
  24. Proof.
  25. fix rela 2.
  26. intros x y.
  27. destruct y as [s|f t].
  28. + exact False.
  29. + refine (or _ _).
  30. exact (Vector.In x t).
  31. simple refine (@Vector.fold_left Terms Prop _ False (fsv f) t).
  32. intros Q e.
  33. exact (or Q (rela x e)).
  34. Defined.
  35.  
  36. Definition snglV {A} (a:A) := Vector.cons A a 0 (Vector.nil A).
  37.  
  38. Definition wfr : @well_founded Terms rela.
  39. Proof.
  40. clear.
  41. unfold well_founded.
  42. assert (H : forall (n:Terms) (a:Terms), (rela a n) -> Acc rela a).
  43. { fix iHn 1.
  44. destruct n.
  45. + simpl. intros a b; destruct b.
  46. + simpl. intros a Q. destruct Q as [L|R].
  47. * admit. (*apply Acc_intro. intros m Hm. apply (iHn a). exact Hm. *)
  48. * admit. (* like in /Arith/Wf_nat.v *)
  49. }
  50. intros a.
  51. simple refine (H _ _ _).
  52. exact (FSC (Build_FSV 0 1) (snglV a)).
  53. simpl.
  54. apply or_introl.
  55. constructor.
  56. Defined.
Advertisement
Add Comment
Please, Sign In to add comment