LeanSearchClient #
In this file, we provide syntax for search using the leansearch API and the Moogle API. from within Lean. It allows you to search for Lean tactics and theorems using natural language.
We provide syntax to make a query and generate TryThis
options to click or
use a code action to use the results.
The queries are of three forms. For leansearch these are:
Command
syntax:#leansearch "search query"
as a command.Term
syntax:#leansearch "search query"
as a term.Tactic
syntax:#leansearch "search query"
as a tactic.
The corresponding syntax for Moogle is:
Command
syntax:#moogle "search query"
as a command.Term
syntax:#moogle "search query"
as a term.Tactic
syntax:#moogle "search query"
as a tactic.
In all cases results are displayed in the Lean Infoview and clicking these replaces the query text. In the cases of a query for tactics only valid tactics are displayed.
Equations
- LeanSearchClient.instInhabitedLoogleMatch = { default := { name := default, type := default, doc? := default } }
Equations
- LeanSearchClient.instReprLoogleMatch = { reprPrec := LeanSearchClient.reprLoogleMatch✝ }
- success: Array LeanSearchClient.SearchResult → LeanSearchClient.LoogleResult
- failure: String → Option (List String) → LeanSearchClient.LoogleResult
Instances For
Equations
- LeanSearchClient.instInhabitedLoogleResult = { default := LeanSearchClient.LoogleResult.success default }
Equations
- LeanSearchClient.instReprLoogleResult = { reprPrec := LeanSearchClient.reprLoogleResult✝ }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The turnstyle uesd bin #find
, unicode or ascii allowed
Equations
- One or more equations did not get rendered due to their size.
Instances For
a single #find
filter. The term
can also be an ident or a strlit,
these are distinguished in parseFindFilters
Equations
- One or more equations did not get rendered due to their size.
Instances For
The argument to #find
, a list of filters
Equations
- LeanSearchClient.loogle_filters = Lean.ParserDescr.nodeWithAntiquot "loogle_filters" `LeanSearchClient.loogle_filters (LeanSearchClient.loogle_filter.sepBy "," (Lean.ParserDescr.symbol ", "))
Instances For
Equations
- LeanSearchClient.loogle_cmd = Lean.ParserDescr.node `LeanSearchClient.loogle_cmd 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "#loogle") LeanSearchClient.loogle_filters)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LeanSearchClient.loogle_term = Lean.ParserDescr.node `LeanSearchClient.loogle_term 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "#loogle") LeanSearchClient.loogle_filters)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.