Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llelf/cocoricoogle
https://github.com/llelf/cocoricoogle
coq perl6 raku
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/llelf/cocoricoogle
- Owner: llelf
- Created: 2019-10-18T20:45:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-21T16:52:45.000Z (about 5 years ago)
- Last Synced: 2024-09-29T10:41:44.037Z (about 2 months ago)
- Topics: coq, perl6, raku
- Language: Perl 6
- Size: 14.6 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+title: An evening experiment in finding lemmas
Why? Because normal ~Search~ won’t find it.
How to use: =cocoricoogle --help=, this README.
You would probably need to do ~apt/pkg/… install rakudo~.#+begin_src coq
~/H/cocoricoogle› ./cocoricoogle -in=ssrnat 'a + b - _ = b'
(* HI. *)
(* Loading. *)
(* Searching (ssrnat). *)
(* 453 entries. 4077 to search. *)addKn
: forall n : nat, cancel (addn n) (subn^~ n)
: forall a b : nat, a + b - a = b(* 1 found. THXBYE. *)
#+end_src* V1 (master branch)
Get a list of definitions by doing ~Search _ in ⟨modules⟩~. Try to match each using
~Check~.Speed: ≈10000/minute.
** mode A
Query is =forall a b…, …= or =… -> forall a b…, …=.
: ./cocoricoogle -in=ssrnat 'forall x y z, x*_ = x*y + x*z'
** mode B
Query doesn’t contain =forall=. Then =--arity= / =-a= comes into play. Default is
=1-3=. Free variables are assumed to be =a=, =b=, =c=, and so forth.=Cocoricoogle= then will try all variants of arities and all permutations of
variables, i. e.
#+begin_src coq
(forall a b) (forall b a) (forall a b c) …
#+end_srcGotchas (~Check~ is too clever):
- [[https://github.com/coq/coq/issues/10849#issuecomment-544257122][WTF#1]]. Search for ~addnAC~ and get ~PeanoNat.Nat.add_shuffle0~ for free.
- ~addnC~ matches ~forall a b, _ + b = _ + _ b~.
- ~(1 * a)%coq_nat = a~ matches ~a + 0 = a~.* V2
Match using =Ltac=. Does works and is measurably faster. Gothas:
- low boundary of arity cannot be arbitrary, because =Ltac= is defined once and
~match ty with forall a, a+b=_ => _ end~ is an error.
- different results of V1* V3
Get the definition list and do everything else in Ltac. Needs a way pass a large(ish)
(at least 1000, but 50000 would be nice) list of definitions as an argument.* V4
Just fix ~Search~.
* TODO¹
- subterms/coercions
- =ssr.ssrbool= vs =ssrbool=
- ~a→b~ vs ~a==b~ vs ~reflect a b~¹) is because github doesn't render it if it's just a «TODO».