Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] rewriting without instantiating

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] rewriting without instantiating


Chronological Thread 
  • From: Armaël Guéneau <armael.gueneau AT ens-lyon.fr>
  • To: coq-club AT inria.fr, Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>
  • Subject: Re: [Coq-Club] rewriting without instantiating
  • Date: Mon, 3 Dec 2018 10:49:15 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=armael.gueneau AT ens-lyon.fr; spf=Pass smtp.mailfrom=armael.gueneau AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Ironport-phdr: 9a23:YalxrRZkC2rRHf8UhEHA77b/LSx+4OfEezUN459isYplN5qZr8+4bnLW6fgltlLVR4KTs6sC17KG9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCa+bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhzsGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJSiJPHI28YYsMAeQPM+lXoIvyqEcBoxalGQmhB/nixiNUinL436A31fkqHwHc3AwnGtIDqGjZrM/wNKgITee1yLHHwzTeb/RM3zfy9pLHcg08qvyLR71wa8/RxlMxGAPBlFmQppHlMC2T1usTqWeb8vFtWvypi248sg1xpjiuxsAqioXTiIIV0EnJ+CNky4g2Pd21UFN3bNG4HJdKtSyXNZF6Tt4jTmxqoio21KMKtYCjcCQX1pgqxATTZviJfoSS4x/uVfydLDl+iXl4YrywnQyy/lKlyuDkVsm7zlJKri1dn9nIrH8CzAfc5dadRvRj+Eehwi+D1wTT6+FDJ0A4j6TbK4Q5zr4xkJocr1jDEzfrlEj5kKOabEcp9+qy5+j6Y7jrpIWQO5Fqhg3gKqgun9awAeU8MggARWib/uG82aX58k3jRbVFlOM5kq3DvJDVOMQUuKi5DBFP3YY+8BuwETGm0M8BkXkDLFNFfxSHg5LnO1HUOPz4F+uwg0ywkDd3wPDLJqHuApLULnTajLjheat95FVHxQoozdFf4opUBasbLPLyXE/xrt3YAQUjPwy62ea0QOl6g4gZQCeEBrKTGKLUq16BoOw1Z6GuaZUYvSe1B/E6/PnoxSsblEUQeLjv8ZIIc3e+Nv1gPgOUbWeqi8pXQkkQuQ9rZfbvgd6GZhFO5nC/Vr90sjghDYurCcHMW42rjbWc9Cq9BdhSd2dATF6WRyS7P76YUusBPXrBavRqlSYJAP34E9d4hEOe8TTiwr8iFdL6vygRtJbtzt9wvraBmBcpsDhlCMLb3XvfFjgozFNNfCc/2eVEmWI40k2KiPMqjvpDUNhC4PUPXB1obceBndw/MMj7X0f6RvnMSFuiRYz3UzU4RNg8hdIIeAN5CtKkyB7ZjXKn

Hi Jeremy,

> I just want it to rewrite ?Φ1 ++ [] ++ ?Φ2 to
> ?Φ1 ++ ?Φ2.

In my experience, ssreflect's rewrite is more conservative with respect
to evars (while the standard rewrite tends to instantiate them with
random stuff making it unusable in presence of evars).

With Coq >= 8.7 you can simply do:

Require Import ssreflect.
Require Import List.
Import ListNotations.

Goal exists (l1 l2 : list nat),
l1 ++ [] ++ l2 = nil.
Proof.
do 2 eexists. rewrite app_nil_l.

(*
============================
?l1 ++ ?l2 = []
*)


(note that the syntax of ssreflect's rewrite is slightly different from
the syntax of the standard rewrite, so you might need to adapt your
existing proofs a bit -- but in the long run, ssreflect's rewrite being
vastly superior makes the effort worth it)

------

Gah, turns out Robbert was faster and gave the same answer while I was
writing this... :-)

— Armaël



Archive powered by MHonArc 2.6.18.

Top of Page