coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jason -Zhong Sheng- Hu <fdhzs2010 AT hotmail.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] ltac definitions
- Date: Mon, 10 Feb 2020 18:38:21 +0000
- Accept-language: en-CA, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nataKRXoQAkusp+94GU1p2z6cVGlG0p0SzWIcE+scRw=; b=azwyglBFfu4K++DhyeoQOtmsTMDf2lbPehMSALHQBOWg1cwAG3o+Ovk3tD+Qq3mHoNO3F/qg9VKXZ9nztFW9PXFnQcpGBjkFKmHvPsQ4QkARW8Cna3Kn8aB6pQGt5eHTfKtBHGxw+yawTrZpQeTwikELJKJbO5sl2htl/h6nqv99n+gwlXCIIfHDpAoCf633ET4b2lF/MN9uRG2qtzO36PsA4Y9XsemcQoYC+uqQXcvO22JzKOnYEzOapGcNN0PDFx3UL4oMtG86uWMVkCxulzGwcoykyLV/1sB0ZciUtbEGjumLffLJkTPQ6hFrX6It2NDyBpDMKU09zNSFYz+Tfg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bhA7kKYGi1jZziCA9ysIMjUVzDuTAvTQlbAhyG+WDbH5WguIr0iyMvNKXhKK8Mp4LVyHjvQT1f0DyIxrWnHM87SfMcfgIErWytHzoT56qeiGbyI1CtUoq3lHL5ao2/ySvQoH5E1dsKPhqd9twxf+8BlVXu1S7ZG+yXNOFRJfAi9T3sOxUKxrTvarI9LCVzveIIKtKlL85mHpg7Fdb7ac3caTeDwflWytjKbW4KM7cVmRm7HyjI0d1o74W5Wld9eqkGGLKXcFpt3G4fmtIwgcgcBAzlGr0R8hZPHtH/uvn+M1fHWW9O0NotvA5rEisR/F1nl8uJxXaltV6T4i7HDvDQ==
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=fdhzs2010 AT hotmail.com; spf=Pass smtp.mailfrom=fdhzs2010 AT hotmail.com; spf=Pass smtp.helo=postmaster AT NAM10-DM6-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:g4+6TxaRTKnCQUjSXWDPHhb/LSx+4OfEezUN459isYplN5qZrsq7bnLW6fgltlLVR4KTs6sC17OK9f65EjVYvd7B6ClELMUXEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUoHdgN6q2O+s5pbdfxtHhCanYbN1MR66sRjdutMZjId/Jas90BrErmZHd+hL2W9lKk+YkxLg6sut5pJu/Dlctvw7+8JcTan2erkzQKBFAjghL207/tDguwPZTQuI6HscU2EWnQRNDgPY8hz0XYr/vzXjuOZl1yaUIcP5TbYvWTS/9KhrUwPniD0GNzEi7m7ajNF7gb9BrxKgoxx/xJPUYJ2QOfFjcK7RYc8WSGxcVclWSiJBH5i8b5MRAOUdIeZWoY79p14Uohu/AwmnGefjxzBMi3Pz26AxzuYvHhzc3AE4H9wArmnarMn7OqkRX+C6zrXHwjrYYvxMxTvx9JLFfgw9rf2RW797bMrfyVMoFwPAllierZbqPyiS1uQLrmOX9ulvVeKoi24hpAF6vyWhxscyhYnPiYIZ003P+ydkwI0oItC4RlN0Yd6lEZtLqS2WK5Z6Tt85TmFovyY61rgGtoS6fCgO0pgo2xnfa/mefoWO/xntWuGRITJii3JkfrKynxmy8Um8yu38S8m7y0xGritCktTKq3sD1ATT59CIR/dh5Eus3SiD2xrc5+1ZO0w5mqnWJ4YvwrEulZcfrUHOEyrsl0nrkKCbckAp9+y15+v6Z7jrpIWTO5N2hwz7KKsihNCwDfo+PwMTRWaU4/6826fm/UDhQLVFkPk2kq7BvZ7COckVobO1DxNM3ogt7BiyDi6q0NMDknYZNl5Ffw+Hj5TyNFHJPfD4C+qwj060kDdxwPDGIqPuDYnRLnjCl7fhe6xx60lByAovydBf4JVUCrIbLP3vXU/xscTUDh4/MwOq3+bqENpw2p8EVW+LHKOVKqzfvUKS6u8gIOSAfIoVtyz8K/gh6f7ul3g5mVoFcKmnwJQXaHG5Hu94L0mFfHbgnswMEWcNvgoiSezlklyCUTpJa3muWKI84yk3CJi6AofbWoCtnLuB0T+nEZ1Rf2BKE0yDEXP1d4qfQPoMcyKTIsp5kjMeT7ShSokh1QuvtADg0bZnIPDUqWUkssep399soubXiBsa9DpuDs3b3XvHBzV/mXpNTDsr1oh+p1Z8wxGNy/4rreZfEIlx7uhOVE9/B57byeMyMND/XA2ENveUAAKoTtW0GmtpF4oZw9gSZk98H5OpiRWVjHniOKMci7HeXM98yanbxXWke5cklyT2kZI5hlxjefNhcHW8j/ckpQjUG4vAkkHfnKGvJ/xFgXz9sVybxG/Lh3l2FQ59VaKZAiI5T26P9ZHVwx2HSLWjT7M6LgFG1MiObLNQbcHkhklHQ/GlP8nCZ2W2mCG7AhPan+rdPrqvQH0U2WDmMGZBlgkS+XicMg1nXXWhpH7bBT1qU1noZhG1/A==
you seem to expect currying to happen here, but last time I checked, Ltac doesn't have that.
I didn't test, but I think the following would work:
Ltac sqr_simps th1 := sqr_simpf (ltac:(fun th2 => apply2 th1 th2)).
the idea to use a Ltac level lambda to ensure the tactic is fully applied.
Thanks,
Jason Hu
From: coq-club-request AT inria.fr <coq-club-request AT inria.fr> on behalf of Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>
Sent: February 9, 2020 11:47 PM
To: coq-club AT inria.fr <coq-club AT inria.fr>
Subject: [Coq-Club] ltac definitions
Sent: February 9, 2020 11:47 PM
To: coq-club AT inria.fr <coq-club AT inria.fr>
Subject: [Coq-Club] ltac definitions
Hi
I'm trying to do
Ltac apply2 th1 th2 := apply th1 || apply th2.
Ltac sqr_simpf applyf :=
list_assoc_r ; repeat (applyf sqr_appL1 || applyf sqr_appL2 ||
... (ie lots more of the same)
Ltac sqr_simps th1 := sqr_simpf (ltac:(apply2) th1).
sqr_simps
But then trying to use sqr_simps I get
sqr_simps sqr_sctr_relRI.
> ^^^^^^^^^
Error:
In nested Ltac calls to "sqr_simps" and "(_ th1)" (with
th1:=sqr_sctr_relRI),
last term evaluation failed.
The user-defined tactic "k4_inv.apply2" was not fully applied:
There are missing arguments for variables th1 and th2,
no arguments at all were provided.
But the first argument is given as sqr_sctr_relRI (ie it gets plugged in
for th1), and the second argument is given at each call of applyf in the
body of sqr_simpf
this gives a similar message
> sqr_simpf (ltac:(apply2) sqr_sctr_relRI).
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:
The user-defined tactic "k4_inv.apply2" was not fully applied:
There are missing arguments for variables th1 and th2,
no arguments at all were provided.
this gives a slightly different message
> sqr_simpf (ltac:(apply2 sqr_sctr_relRI)).
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:
The user-defined tactic "k4_inv.apply2" was not fully applied:
There is a missing argument for variable th2,
an argument was provided for variable th1.
Also I tried this: (which isn't actually what I want to do)
sqr_simpf (ltac:(apply)).
> ^^^^^^^^^^^^
Error:
In nested Ltac calls to "_" and "apply", last call failed.
No product even after head-reduction.
thanks,
Jeremy
- [Coq-Club] ltac definitions, Jeremy Dawson, 02/10/2020
- Re: [Coq-Club] ltac definitions, Jason -Zhong Sheng- Hu, 02/10/2020
Archive powered by MHonArc 2.6.18.