coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Daniel Schepler <dschepler AT gmail.com>
- To: Wilayat Khan <wilayatk AT gmail.com>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Coq - String List Sort Lemma
- Date: Sun, 19 May 2013 11:33:24 -0700
Personally, I prefer to write comparison operators to be more like Perl's <=> operator. And I don't really like to use { x < y } + { x = y } + { x > y } as the result of this, as the constructors of the different cases are a bit awkward to look at. (And even though that could probably be worked around using notations, the extraction would still have the asymmetrical ugliness.) So I roll my own inductive type "comparison_with_proof" for the result, since I couldn't find any suitable inductive type in the standard library that did exactly what I wanted.
So, this thread inspired me to mock up what proof-carrying comparison operators on ascii and string might look like, in the attached file. A couple points: First, the proofs of vector_lt_irrefl, vector_lt_trans, string_lt_irrefl would probably get bad marks in one of Prof. Chlipala's classes as insufficiently automated... And in more general cases, you'd probably want to allow a general equivalence relation in place of eq for those cases where you're using setoids and you don't want to (or can't) define an explicit quotient type of the setoid.
--
Daniel Schepler
Attachment:
StringCompare.v
Description: Binary data
- [Coq-Club] Coq - String List Sort Lemma, Wilayat Khan, 05/19/2013
- Re: [Coq-Club] Coq - String List Sort Lemma, Jonas Oberhauser, 05/19/2013
- Re: [Coq-Club] Coq - String List Sort Lemma, Daniel Schepler, 05/19/2013
- Re: [Coq-Club] Coq - String List Sort Lemma, Jonas Oberhauser, 05/19/2013
- Re: [Coq-Club] Coq - String List Sort Lemma, Daniel Schepler, 05/19/2013
- Re: [Coq-Club] Coq - String List Sort Lemma, Jonas Oberhauser, 05/19/2013
- Re: [Coq-Club] Coq - String List Sort Lemma, Daniel Schepler, 05/19/2013
- Message not available
- Message not available
- Re: [Coq-Club] Coq - String List Sort Lemma, Jonas Oberhauser, 05/19/2013
- Message not available
- Re: [Coq-Club] Coq - String List Sort Lemma, Jonas Oberhauser, 05/19/2013
- Message not available
- Message not available
- Re: [Coq-Club] Coq - String List Sort Lemma, Jonas Oberhauser, 05/20/2013
- Message not available
Archive powered by MHonArc 2.6.18.