coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Cedric Auger <sedrikov AT gmail.com>
- To: Anders Lundstedt <anders AT anderslundstedt.se>
- Cc: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Notation for partial terms
- Date: Mon, 13 Jan 2014 10:00:49 +0100
2014/1/13 Anders Lundstedt <anders AT anderslundstedt.se>
Dear all,given a partial binary operationf : A -> A -> option Ais there a convenient way to write partial expressions (with left associativity)? I would like to be able to write e.g.a*b*c*dwhich would be equal to Some e ifa*b=Some xx*c=Some yy*d=Some efor some x y : A, otherwise we would have a*b*c*d = None.Best regards,Anders Lundstedt
Alternatively to A. Spiwack suggestion, you can also define:
Definition extension3 (x:option A) : A -> option A :=
match x with
| Some x' => f x'
| _ => fun _ => None
end
.
Notation "! a" := (Some a) (at level xx).
Notation "a * b" := (extension3 a b) (at level yy).
---
with xx < yy
Now, you would have to write "! a * b * c * d = ! e" (or "! a * b * c * d = Some e")
instead of "a * b * c * d = Some e" as you wished; still I do not think it is much annoying.
--
.../Sedrikov\...
- [Coq-Club] Notation for partial terms, Anders Lundstedt, 01/13/2014
- Re: [Coq-Club] Notation for partial terms, Arnaud Spiwack, 01/13/2014
- Re: [Coq-Club] Notation for partial terms, Cedric Auger, 01/13/2014
- Re: [Coq-Club] Notation for partial terms, Anders Lundstedt, 01/13/2014
Archive powered by MHonArc 2.6.18.