-
Notifications
You must be signed in to change notification settings - Fork 43
Improvements and new features for indexing #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
7efd7c0
a4c58ff
b87fc34
52ec33c
40f3efb
02489ef
a01c625
0a4b1d6
15bfaef
4e7a4cf
9b59ee2
dc5b98b
c7bf80b
60f9e01
94b610a
cecd16f
caa4f00
8de1444
f8c1059
d4ab72d
821b234
20c5c68
ef93bca
d1efd65
18154ae
790dc09
6d0ed69
8b59305
7ff31c7
1f7259e
9c8d003
bdad1e1
954a32b
f1d2886
759dd90
e19588d
3ebc4cf
9a0de11
2c5480c
43a4ef1
0f9cf9f
14d8897
2b88b50
d868fb4
7471203
107d690
4a48965
f3f5a35
c331b1f
95dd63d
ccb5489
16d7303
ea6119b
c284cb7
1084b34
8e310fb
c9936eb
b8de408
c4184a3
c081f17
ca9cc43
0b4510c
d52e097
4029583
fef80b6
815de13
877b789
9ac9d8c
14c2a83
12c120e
9a8b561
fed5a8b
95f9a3e
e0d1113
ba28cb2
c4ddede
157acc1
9161424
e1d3493
feb27a7
5d4a682
563f13c
b93e07c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ Queries can be expressed according to the following syntax: | |
|
|
||
| Q ::= B | Q with Q | Q|Q | Q in PATH | ||
| B ::= WHERE HOW GENERALIZE? PATTERN | ||
| PATH ::= << string >> | ||
| PATH ::= <identifier> | "<regexp>" | ||
| WHERE ::= name | anywhere | rule | lhs | rhs | type | concl | hyp | spine | ||
| HOW ::= > | = | >= | ≥ | ||
| GENERALIZE ::= generalize | ||
|
|
@@ -19,10 +19,12 @@ where | |
| * parentheses can be used as usual to force a different precedence order | ||
| * ``anywhere`` can be paired only with ``>=`` and ``name`` can be paired only with ``>=`` and no ``generalize`` | ||
| * a pattern should be wrapped in parentheses, unless it is atomic (e.g. an identifier or a placeholder) | ||
| * a pattern is expressed using the Lambdapi terms syntax. Additionaly, the search engine allows the use of a basic Rocq syntax to express terms. | ||
| Specifically, ``fun``, ``forall``, ``exists``, ``/\`` and ``~`` are supported to express terms inside the pattern. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
a pattern is expressed using the Lambdapi terms syntax. Additionaly, the search engine allows the use of a basic Rocq syntax to express terms. Specifically, |
||
|
|
||
| The semantics of the query language is the following: | ||
|
|
||
| * a query ``Q`` is either a base query ``B``, the conjunction ``Q1 with Q2`` of two queries ``Q1`` and ``Q2``, their disjunction ``Q1 | Q2`` or the query ``Q in PATH`` that behaves as ``Q``, but only keeps the results whose path is a suffix of ``PATH`` (that must be a valid path prefix) | ||
| * a query ``Q`` is either a base query ``B``, the conjunction ``Q1 with Q2`` of two queries ``Q1`` and ``Q2``, their disjunction ``Q1 | Q2`` or the query ``Q IN PATH`` that behaves as ``Q``, but only keeps the results whose path is a suffix of ``PATH`` (that must be a valid path prefix) or matches the regular expression between double quotes (``""``) | ||
| * a base query ``name = ID`` looks for symbols with name ``ID`` in the library. | ||
| The identifier ``ID`` must not be qualified. | ||
| * a base query ``WHERE HOW GENERALIZE? PATTERN`` looks in the library for occurrences of the pattern ``PATTERN`` **up to normalization rules** and, if ``generalize`` is specified, also **up to generalization** of the pattern. The normalization rules are library specific and are employed during indexing. They can be used, for example, to remove the clutter associated to encodings, to align concepts by mapping symbols to cross-library standard ones, or to standardize the shape of statements to improve recall (e.g. replacing occurrence of ``x > y`` with ``y < x``). | ||
|
|
@@ -42,8 +44,6 @@ The semantics of the query language is the following: | |
| * ``=`` the pattern must match the whole position | ||
| * ``>`` the pattern must match a strict subterm of the position | ||
|
|
||
| Note that for commodity, ``forall`` and ``->`` can be used inside the query instead of the Unicode characters ``Π`` and ``→`` respectively. | ||
|
|
||
| Examples: | ||
|
|
||
| * ``hyp = (nat → bool) with hyp >= (list nat)`` | ||
|
|
@@ -53,5 +53,9 @@ Examples: | |
| in a module whose path is a suffix of ``math.arithmetics``. The query | ||
| can return ``plus_O : ∀x: nat. plus x O = x`` where ``plus_O`` has | ||
| fully qualified name ``math.arithmetics.addition.plus`` | ||
| * ``concl > plus | "*.arithmetics"`` | ||
| searches for theorems having an hypothesis containing ``plus`` and located | ||
| in a module whose path matches ``*.arithmetics``. The query | ||
| can return ``math.arithmetics.addition.plus`` and ``mathematics.arithmetics.addition.plus`` | ||
| * ``name = nat | name = NAT`` | ||
| searches for symbols named either ``nat`` or ``NAT`` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"> | ||
|
|
||
| <style> | ||
| .snippet { | ||
| border: 1px solid grey; /* Bordure grise */ | ||
| color: red; /* Texte en rouge */ | ||
| padding: 0 3px 0 3px; /* Espace autour du texte à l'intérieur de la bordure */ | ||
| line-height: 1.6; | ||
| } | ||
| code { | ||
| font-family: "Courier New", Courier, monospace; | ||
| background-color:rgb(8, 8, 8); | ||
| padding: 2px 4px; | ||
| border-radius: 4px; | ||
| color:rgb(43, 230, 52); | ||
| font-size: 1.3em; | ||
| white-space: normal; | ||
| } | ||
| #description { | ||
| margin-top: 10px; | ||
| padding: 10px; | ||
| background-color: #f0f0f0; | ||
| border: 1px solid #ccc; | ||
| } | ||
| button { | ||
| width: 100%; | ||
| cursor: pointer; | ||
| /* margin-top: 10px; */ | ||
| /* padding: 10px; */ | ||
| background-color: #f0f0f0; | ||
| border: 1px solid #ccc; | ||
| } | ||
| .header { | ||
| position: relative; /* Conteneur pour les liens */ | ||
| width: 100%; | ||
| height: 80px; | ||
| background-color: #f1f1f1; | ||
| } | ||
| .top-right-link { | ||
| position: absolute; | ||
| top: 10px; | ||
| right: 10px; | ||
| text-decoration: none; | ||
| background-color: #007BFF; | ||
| color: white; | ||
| padding: 10px 20px; | ||
| border-radius: 5px; | ||
| font-size: 18px; | ||
| text-align: center; | ||
| } | ||
| .top-right-link span { | ||
| display: block; | ||
| font-size: 12px; | ||
| } | ||
| .top-right-link:hover { | ||
| background-color: #0056b3; | ||
| } | ||
| .top-left-link { | ||
| position: absolute; | ||
| top: 10px; | ||
| left: 10px; | ||
| text-decoration: none; | ||
| background-color: #007BFF; | ||
| color: white; | ||
| padding: 10px 20px; | ||
| border-radius: 5px; | ||
| font-size: 18px; | ||
| text-align: center; | ||
| } | ||
| .top-left-link span { | ||
| display: block; | ||
| font-size: 12px; | ||
| } | ||
| .top-left-link:hover { | ||
| background-color: #0056b3; | ||
| } | ||
| </style> | ||
|
|
||
| <div class="header"> | ||
| <a href="https://github.com/Deducteam/lambdapi/issues/new" target="_blank" class="top-right-link"><span>Something went wrong?</span>Open an issue</a> | ||
| <a href="https://github.com/Deducteam/lambdapi/discussions/1214" target="_blank" class="top-left-link"><span>Like this tool?</span>Join the discussion</a> | ||
| <h1 style="text-align: center;"><a href="https://github.com/Deducteam/lambdapi">LambdaPi</a> Search Engine</h1> | ||
| </div> | ||
|
|
||
| <div id="descriptionSection" style="display: %%HIDE_DESCRIPTION%%;"> | ||
|
|
||
|
|
||
| <p> | ||
| The <b>search</b> button answers the query. Read the <a href= | ||
| \"https://lambdapi.readthedocs.io/en/latest/query_language.html\"> | ||
| query language specification</a> to learn about the query language. | ||
| <br>The query language also uses the <a | ||
| href=\"https://lambdapi.readthedocs.io/en/latest/terms.html\"> | ||
| Lambdapi terms syntax</a>.<br> | ||
| while supporting a subset of the Rocq syntax (specificaly, | ||
| terms using fun, forall, exists, /\ and ~ are allowed) | ||
| In particular, the following constructors can come handy for | ||
| writing queries:<br> | ||
| </p> | ||
| <ul> | ||
| <li>an anonymous function<span class=\"snippet\">λ (x:A) y z,t</span> | ||
| mapping <span class=\"snippet\">x</span>, <span class=\"snippet\">y | ||
| </span> and <span class=\"snippet\">z</span> (of type <span class=\" | ||
| snippet\">A</span> for <span class=\"snippet\">x</span>) to <span | ||
| class=\"snippet\">t</span>.</li> | ||
| <li>a dependent product | ||
| <span class=\"snippet\">forall (x:A) y z,T</span> | ||
| </li> | ||
| <li>a non-dependent product <span class=\"snippet\">A -> T</span> | ||
| (syntactic sugar for <span class=\"snippet\">forall x:A,T</span> when | ||
| <span class=\"snippet\">x</span> does not occur in <span class= | ||
| \"snippet\">T</span>)</li> | ||
| </ul> | ||
|
|
||
| </div> | ||
|
|
||
| </script> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| (library | ||
| (name ressources) | ||
| (public_name lambdapi.ressources) | ||
| (modules :standard) | ||
| (libraries lambdapi.parsing lambdapi.core dream unix dune-site) | ||
| (preprocess (pps lwt_ppx)) | ||
| ) | ||
|
|
||
| (install | ||
| (section (site (lambdapi server_resources))) | ||
| (files | ||
| (description.html as default/description.html) | ||
| (lambdapi.ico as default/lambdapi.ico) | ||
| ) | ||
| ) | ||
|
|
||
| (generate_sites_module | ||
| (module mysites) | ||
| (sites lambdapi)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really?