coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Joey Eremondi <joey.eremondi AT gmail.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Doing something n times with backgtracking
- Date: Sat, 18 Aug 2018 15:34:05 -0700
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=joey.eremondi AT gmail.com; spf=Pass smtp.mailfrom=joey.eremondi AT gmail.com; spf=None smtp.helo=postmaster AT mail-wr1-f44.google.com
- Ironport-phdr: 9a23:xQZ1mxHPEuOSDz6jATq9yp1GYnF86YWxBRYc798ds5kLTJ78osWwAkXT6L1XgUPTWs2DsrQY07SQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDuwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KODE5/m/ZicJ+kbxVrw66qhNl34LZepuYOOZicq7fe94RWGpPXtxWVyxEGo6ya4wPAPQBPO1FoIf9vUUBrR65BQmqGezvyyJDi3j03a09zesgERvK0xI6H90QtXTUq9P1O7oTUe2uw6nIyC/Mb/JS2Tvn9IfIdRUhrOiKULltf8TRzkwvGBnEjlWWsYHlJC+V2f4RvGiY6OpgS/ygi3QpqwF1pTiuyN0ghZXOhoIQzF3P6CZ3wJ4tKNGmVEJ2ZcSoHZhQui2AKYd6XN4uT3tntSs1zLANpIS1czIQyJs9wh7Sc/yHfJaM4hLkTOuRJC13hHNheL6miRey61WsxvTyVsS731tGtCVFkt7LtnAC0xzc9NKLRed6/kekwTqP1gbT5f9YIU0si6bXN5oszqQzm5cTq0jPADH6lFjsgKKZeUgo4u2o5P7mYrXiqJ+cLYh0igTmP6QsncywH+Q5PhIQUGiB5+u80brj/UvkT7VLlfA2nazZv4rbJcQfvKK2HwhV0oM75xalEzimyMgYnWUALF9dZB2HiJHpN0jSL/D8EPewmE+hkCxrxvDDJr3uGI/BLnnFkLf7fLZy8VRQyAQpzYMX25UBAbYYZfn3R0XZtdrCDxZ/PRbn7fzgDYBf0Y4PEU+VD6qeNq/T+QuK4e8+ZeSWaYoSvjr8A/cg7v/qy3Q+nAlOLuGSwZILZSXgTbxdKEKDbC+024ZTISIxpgM7CdfSphiHWD9XaWy1WvtltD4+AYOiS4zEQ9L02eDT7GKABpRTI1t+JBWUC36xLteLXv4NbGSZJcozymVZB4jkcJco0FSVjCG/y7djKbCJqCgRtJamy8IsouOPyVc98jt7C8nb2GaIHTl5
Disclaimer: cross-posted on StackOverflow at https://stackoverflow.com/questions/51905979/ltac-repeating-a-tactic-n-times-with-backtracking
Suppose I have a tactic like this (taken from HaysTac), that searches for an argument to specialize a particular hypothesis with:
Ltac find_specialize_in H :=
multimatch goal with
| [ v : _ |- _ ] => specialize (H v)
end.
However, I'd like to write a tactic that searches for `n` arguments to specialize a tactic with. The key is that it needs to backtrack. For example, if I have the following hypotheses:
y : T
H : forall (x : T), x = y -> P x
x1 : T
x2 : T
Heq : x1 = y
If I write `do 2 (find_specialize_in H)`, it might choose `x2` to instantiate it, then fail trying to find a second argument. So I need my repeat loop to be able to backtrack with which arguments it chooses to specialize earlier arguments.
Is it possible to do this? How can I make a tactic loop that backtracks with its choices of previous iterations?
Thanks,
Joey
- [Coq-Club] Doing something n times with backgtracking, Joey Eremondi, 08/19/2018
- Re: [Coq-Club] Doing something n times with backgtracking, Maximilian Wuttke, 08/19/2018
- Re: [Coq-Club] Doing something n times with backgtracking, Jason -Zhong Sheng- Hu, 08/19/2018
- Re: [Coq-Club] Doing something n times with backgtracking, Joey Eremondi, 08/20/2018
- Re: [Coq-Club] Doing something n times with backgtracking, Jason -Zhong Sheng- Hu, 08/19/2018
- Re: [Coq-Club] Doing something n times with backgtracking, Maximilian Wuttke, 08/19/2018
Archive powered by MHonArc 2.6.18.