Subject: Ssreflect Users Discussion List
List archive
- From: Nicolas Magaud <>
- To:
- Subject: [ssreflect] Defining functions of fintypes
- Date: Wed, 27 Sep 2017 14:19:36 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:FWhp3x++gHC1MP9uRHKM819IXTAuvvDOBiVQ1KB+1ewcTK2v8tzYMVDF4r011RmSAtWdtqoMotGVmp6jcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS46tL2HV92ap9zMcHhj0KSJwPf6wG4jIjs3x1uao+pSVbR8bqiC6ZOZULR6xqQzK/uwfjoJ/Ju5lzxLGq2ZEU/lQxHh0P1vVkQyqtZT4x4Jq7ykF46FpzMVHS6ivJ6k=
Dear all,
I have trouble defining finite functions (on finite domains) which have 2 or
more arguments using the [] notation.
Below is a example of what I am trying to do.
I would like to define the function f’ using pattern matching on a couple or
on the 2 separate arguments (in a currified way) but without doing explicit
lambda-abstraction.
Is there a way to do that ? This would make the code more readable once the
fun and => keywords are gone.
Nicolas Magaud
(* full example *)
Definition Symb := 'I_3.
(* code that works *)
Definition easy := [fun x : Symb => 0 with 0 |-> 16, 1 |-> 18, 2|-> 34].
Definition f :=
[ fun x:Symb =>
[ fun y:Symb => 0 with
0 |-> [fun x':Symb => 17 with 0 |-> 42, 1 |-> 7, 2 |-> 28] x,
1 |-> [fun x':Symb => 34 with 0 |-> 2, 1 |-> 8, 2 |-> 70] x,
2 |-> [fun x':Symb => 72 with 0 |-> 116, 1 |-> 53, 2 |-> 47] x]].
(* code I would like to write or something like that, i.e. with no
lambda-abstractions *)
Definition f' :=
[fun (x,y) => 0 with (0,0) |-> 42,
(0,1) |- 7,
(0,2) |- 28,
(1,0) |-> 2,
(1,1) |- 8,
(1,2) |- 70,
(2,0) |-> 116,
(2,1) |- 53,
(2,2) |- 47].
- [ssreflect] Defining functions of fintypes, Nicolas Magaud, 09/27/2017
- Re: [ssreflect] Defining functions of fintypes, Emilio Jesús Gallego Arias, 09/27/2017
- Re: [ssreflect] Defining functions of fintypes, Cyril, 09/27/2017
- Re: [ssreflect] Defining functions of fintypes, Assia Mahboubi, 09/27/2017
- Re: [ssreflect] Defining functions of fintypes, Nicolas Magaud, 09/28/2017
- Re: [ssreflect] Defining functions of fintypes, Yves Bertot, 09/28/2017
- Re: [ssreflect] Defining functions of fintypes, Cyril, 09/28/2017
- Re: [ssreflect] Defining functions of fintypes, Assia Mahboubi, 09/28/2017
- Re: [ssreflect] Defining functions of fintypes, Nicolas Magaud, 09/29/2017
- Re: [ssreflect] Defining functions of fintypes, Assia Mahboubi, 09/28/2017
- Re: [ssreflect] Defining functions of fintypes, Cyril, 09/28/2017
- Re: [ssreflect] Defining functions of fintypes, Yves Bertot, 09/28/2017
Archive powered by MHonArc 2.6.18.