Guest User

Untitled

a guest
Jan 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Ltac pointlessRecurse depth hyp cont list :=
  2. match depth with
  3. | 0 => (specialize (hyp list); cont) || fail 100 "Ran out of depth"
  4. | S ?n => (specialize (hyp list); cont) || pointlessRecurse n hyp cont (true :: list) || pointlessRecurse n hyp cont (false :: list)
  5. | _ => fail 100 "recursion failed"
  6. end.
  7.  
  8. Ltac pointlessSearch depth :=
  9. match goal with
  10. | [ H : forall ls1 ls2, _ |- _ ] => pointlessRecurse depth H ltac:(pointlessSearch depth) (@nil bool)
  11. | [ H : forall ls, _ |- _ ] => pointlessRecurse depth H discriminate (@nil bool)
  12. | _ => fail 1 "fail on hyp"
  13. end.
  14.  
  15. Ltac pointless depth :=
  16. match goal with
  17. | [ H : _ |- _ ] => fail 1 "Should be first tactic run"
  18. | [ |- ?P ] => assert (Hcontr : P -> False); [ intro Hn; specialize (Hn bool); pointlessSearch depth | ]
  19. | _ => fail 1 "failed"
  20. end.
Add Comment
Please, Sign In to add comment