affeldt-aist / monae Goto Github PK
View Code? Open in Web Editor NEWMonadic effects and equational reasonig in Coq
License: GNU Lesser General Public License v2.1
Monadic effects and equational reasonig in Coq
License: GNU Lesser General Public License v2.1
First of all, I would like to thank all the contributors to this library!
For our project, we've been searching for a Coq library of monad theory and among few alternatives we chose monae
.
Currently, we need just a basic stuff: basic hierarchy (functors, natural transformations, monads, nondet monads) and basic instances (list, state, etc). We've been really happy to find everything we need in monae
.
However, a big list of library dependencies was a bit disappointing.
For example, a dependency on coq-infotheo
was surprising, as well as dependencies on mathcomp-fingroup
, mathcomp-solvable
, etc. From what I understood after a quick pass over the sources, coq-infotheo
is used mostly for the probability monad. The boolp.v
library from mathcomp-analysis
is used heavily for "classical" reasoning. I haven't understood how mathcomp-fingroup
, mathcomp-field
, etc are used.
Since the monad theory is a cornerstone of PL theory, it would be really nice to have a core library of monad theory with a minimalistic list of dependencies. If you'll be interested in achieving this goal I would be happy to help with this and prepare a PR.
I think there are two possible ways to achieve this:
(1) split the library into two: something like monae-core
with a basic hierarchy of monads and common theory,
and e.g. monae-prob
with the probability monad
(2) use opam's depopts
feature and install various advanced features of the library (e.g. prob monad) only if the user already has all required packages installed.
Line 1168 in 66032e5
should be attached to proba_monad_scope
The notations on top of hierarchy.bind
(>>=
, the do notation) seem to be broken with HB.
They parse but do not always display.
Line 53 in 3119194
now that failR0 has been introduced (should be easier with HB)
Lines 659 to 667 in 5bfc22a
A similar lemma should appear in analysis soon. Let us keep this one for a while until it is subsumed
instead of moving it to infotheo.
(Put it here because I do not have writing rights, and not really worth forking for just that)
Lemma image_preserves_convex_hull (A B : finType) (f : {affine {dist A} -> {dist B}})
(Z : set {dist A}) : f @` hull Z = hull (f @` Z).
Proof.
rewrite predeqE => b; split.
case=> a [n [g [e [Hg]]]] ->{a} <-{b}.
exists n, (f \o g), e; split.
move=> b /= [i _] <-{b} /=.
by exists (g i) => //; apply Hg; exists i.
by rewrite affine_function_Sum.
case=> n [g [e [Hg]]] ->{b}.
suff [h Hh] : exists h : 'I_n -> dist_convType A, forall i, h i \in Z /\ f (h i) = g i.
exists (\Sum_e h).
exists n; exists h; exists e; split => //.
move=> a [i _] <-.
move: (Hh i) => [].
by rewrite in_setE.
rewrite affine_function_Sum; apply eq_convn => // i /=.
by case: (Hh i).
apply (@fin_all_exists _ _ (fun i hi => hi \in Z /\ f hi = g i)) => i.
case: (Hg (g i)); first by exists i.
move=> a // HZa Hfa.
exists a; split; by rewrite // in_setE.
Qed.
Line 191 in acf8728
bigcup_of_singleton
and bigcup_image
will be in the next version of mathcomp-analysis
and this dependency wrt infotheo can be removed
NB: bigcup_of_singleton
became bigcup_of_set1
Line 1389 in e5b7ecd
Line 114 in 3026410
might go the fail_lib.v
Line 374 in 56087f1
this does not need to be constrained to the type of natural transformations ~>
Lines 24 to 43 in 56087f1
using the following pragma
#[short(type="blahType", pack="BlahType")]
in hierarchy.v
Line 6 in 0a28475
instead of ssrZ.v
The definition of qperm function in the quicksort branch requires an interaction between fixpoints and binds to show its termination.
Currently there is no such mechanism, and it seems hard to finish the definition.
One possible solution is in http://leventerkok.github.io/papers/mfix.pdf : the monadic fixpoint operator mfix.
Let's see if this mfix can be added to monae with useful laws and if this enables quicksort.
Line 106 in 3026410
keep only the <= versions
In Record isMonadArray
in hierarchy.v,
agetpustskip : forall i, aget i >>= aput i = skip ;
this line has a typo: agetpustskip
-> agetputskip
?
Do we want to keep the file demo_plusMonad.v? @AyumuSaito
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.