Equations
Instances For
Equations
Instances For
Equations
Instances For
Instances For
Additional version description like "nightly-2018-03-11"
Instances For
Equations
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
This function can be used to detect whether the compiler has support for generating LLVM instead of C. It is used by lake instead of the --features flag in order to avoid having to run a compiler for this every time on startup. See #2572.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.isIdFirst c = (Char.isAlpha c || decide (c = '_') || Lean.isLetterLike c)
Instances For
Equations
- Lean.isIdRest c = (Char.isAlphanum c || decide (c = '_') || decide (c = ''') || c == '!' || c == '?' || Lean.isLetterLike c || Lean.isSubScriptAlnum c)
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.removeLeadingSpaces s = let n := Lean.findLeadingSpacesSize s; if (n == 0) = true then s else Lean.removeNumLeadingSpaces n s
Instances For
Equations
- Lean.Name.getRoot Lean.Name.anonymous = Lean.Name.anonymous
- Lean.Name.getRoot (Lean.Name.str Lean.Name.anonymous str) = Lean.Name.str Lean.Name.anonymous str
- Lean.Name.getRoot (Lean.Name.num Lean.Name.anonymous i) = Lean.Name.num Lean.Name.anonymous i
- Lean.Name.getRoot (Lean.Name.str n str) = Lean.Name.getRoot n
- Lean.Name.getRoot (Lean.Name.num n i) = Lean.Name.getRoot n
Instances For
Equations
- Lean.Name.isInaccessibleUserName (Lean.Name.str pre s) = (String.contains s '✝' || s == "_inaccessible")
- Lean.Name.isInaccessibleUserName (Lean.Name.num p i) = Lean.Name.isInaccessibleUserName p
- Lean.Name.isInaccessibleUserName x = false
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Name.toStringWithSep sep escape Lean.Name.anonymous = "[anonymous]"
- Lean.Name.toStringWithSep sep escape (Lean.Name.str Lean.Name.anonymous s) = Lean.Name.toStringWithSep.maybeEscape escape s
- Lean.Name.toStringWithSep sep escape (Lean.Name.num Lean.Name.anonymous v) = toString v
- Lean.Name.toStringWithSep sep escape (Lean.Name.str n s) = Lean.Name.toStringWithSep sep escape n ++ sep ++ Lean.Name.toStringWithSep.maybeEscape escape s
- Lean.Name.toStringWithSep sep escape (Lean.Name.num n v) = Lean.Name.toStringWithSep sep escape n ++ sep ++ Nat.repr v
Instances For
Equations
- Lean.Name.toStringWithSep.maybeEscape escape s = if escape = true then Option.getD (Lean.Name.escapePart s) s else s
Instances For
Equations
- Lean.Name.toString.maybePseudoSyntax n = match Lean.Name.getRoot n with | Lean.Name.str pre s => String.isPrefixOf "#" s || String.isPrefixOf "?" s | x => false
Instances For
Equations
- Lean.Name.instToStringName = { toString := fun (n : Lake.Name) => Lean.Name.toString n }
Equations
- One or more equations did not get rendered due to their size.
- Lean.Name.reprPrec Lean.Name.anonymous prec = Std.Format.text "Lean.Name.anonymous"
- Lean.Name.reprPrec (Lean.Name.num pre i) prec = Repr.addAppParen (Std.Format.text "Lean.Name.mkNum " ++ Lean.Name.reprPrec pre 1024 ++ Std.Format.text " " ++ repr i) prec
Instances For
Equations
- Lean.Name.instReprName = { reprPrec := Lean.Name.reprPrec }
Equations
- Lean.Name.capitalize x = match x with | Lean.Name.str p s => Lean.Name.str p (String.capitalize s) | n => n
Instances For
Equations
- Lean.Name.replacePrefix Lean.Name.anonymous Lean.Name.anonymous x = x
- Lean.Name.replacePrefix Lean.Name.anonymous x✝ x = Lean.Name.anonymous
- Lean.Name.replacePrefix (Lean.Name.str p s) x✝ x = if (Lean.Name.str p s == x✝) = true then x else Lean.Name.mkStr (Lean.Name.replacePrefix p x✝ x) s
- Lean.Name.replacePrefix (Lean.Name.num p s) x✝ x = if (Lean.Name.num p s == x✝) = true then x else Lean.Name.mkNum (Lean.Name.replacePrefix p x✝ x) s
Instances For
eraseSuffix? n s
return n'
if n
is of the form n == n' ++ s
.
Equations
- Lean.Name.eraseSuffix? x Lean.Name.anonymous = some x
- Lean.Name.eraseSuffix? (Lean.Name.str p s) (Lean.Name.str p' s') = if (s == s') = true then Lean.Name.eraseSuffix? p p' else none
- Lean.Name.eraseSuffix? (Lean.Name.num p s) (Lean.Name.num p' s') = if (s == s') = true then Lean.Name.eraseSuffix? p p' else none
- Lean.Name.eraseSuffix? x✝ x = none
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.
Instances For
Equations
- Lean.NameGenerator.next g = { namePrefix := g.namePrefix, idx := g.idx + 1 }
Instances For
Equations
- Lean.NameGenerator.mkChild g = ({ namePrefix := Lean.Name.mkNum g.namePrefix g.idx, idx := 1 }, { namePrefix := g.namePrefix, idx := g.idx + 1 })
Instances For
- getNGen : m Lean.NameGenerator
- setNGen : Lean.NameGenerator → m Unit
Instances
Equations
- Lean.mkFreshId = do let ngen ← Lean.getNGen let r : Lake.Name := Lean.NameGenerator.curr ngen Lean.setNGen (Lean.NameGenerator.next ngen) pure r
Instances For
Equations
- Lean.monadNameGeneratorLift m n = { getNGen := liftM Lean.getNGen, setNGen := fun (ngen : Lean.NameGenerator) => liftM (Lean.setNGen ngen) }
Equations
- Lean.Syntax.instReprPreresolved = { reprPrec := Lean.Syntax.reprPreresolved✝ }
Equations
- Lean.Syntax.instReprSyntax = { reprPrec := Lean.Syntax.reprSyntax✝ }
Equations
- Lean.Syntax.instReprTSyntax = { reprPrec := Lean.Syntax.reprTSyntax✝ }
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Instances For
Equations
Instances For
Instances For
Equations
- Lean.TSyntax.instCoeTSyntaxConsSyntaxNodeKindNil = { coe := fun (stx : Lean.TSyntax k) => { raw := stx.raw } }
Equations
- Lean.TSyntax.instCoeTSyntaxConsSyntaxNodeKind = { coe := fun (stx : Lean.TSyntax ks) => { raw := stx.raw } }
Equations
- Lean.TSyntax.instCoeIdentTerm = { coe := fun (s : Lean.Ident) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeDepTermMkConsSyntaxNodeKindMkStr1NilIdentIdent = { coe := { raw := Lean.Syntax.ident info ss n res } }
Equations
- Lean.TSyntax.instCoeStrLitTerm = { coe := fun (s : Lean.StrLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeNameLitTerm = { coe := fun (s : Lean.NameLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeScientificLitTerm = { coe := fun (s : Lean.ScientificLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeNumLitTerm = { coe := fun (s : Lean.NumLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeCharLitTerm = { coe := fun (s : Lean.CharLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeIdentLevel = { coe := fun (s : Lean.Ident) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeNumLitPrio = { coe := fun (s : Lean.NumLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeNumLitPrec = { coe := fun (s : Lean.NumLit) => { raw := s.raw } }
Equations
- Lean.TSyntax.Compat.instCoeTailSyntaxTSyntax = { coe := fun (s : Lean.Syntax) => { raw := s } }
Instances For
Equations
- Lean.TSyntax.Compat.instCoeTailArraySyntaxTSyntaxArray = { coe := Lean.TSyntaxArray.mk }
Instances For
Equations
Compare syntax structures modulo source info.
Equations
- Lean.Syntax.instBEqSyntax = { beq := Lean.Syntax.structEq }
Equations
- Lean.Syntax.instBEqTSyntax = { beq := fun (x x_1 : Lean.TSyntax k) => x.raw == x_1.raw }
Equations
Instances For
Equations
- Lean.Syntax.getTrailingSize stx = match Lean.Syntax.getTailInfo? stx with | some (Lean.SourceInfo.original leading pos trailing endPos) => Substring.bsize trailing | x => 0
Instances For
Return substring of original input covering stx
.
Result is meaningful only if all involved SourceInfo.original
s refer to the same string (as is the case after parsing).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.setTailInfo stx info = match Lean.Syntax.setTailInfoAux info stx with | some stx => stx | none => stx
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.setHeadInfo stx info = match Lean.Syntax.setHeadInfoAux info stx with | some stx => stx | none => stx
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return the first atom/identifier that has position information
Equations
- Lean.Syntax.copyHeadTailInfoFrom target source = Lean.Syntax.setTailInfo (Lean.Syntax.setHeadInfo target (Lean.Syntax.getHeadInfo source)) (Lean.Syntax.getTailInfo source)
Instances For
Ensure head position is synthetic. The server regards syntax as "original" only if both head and tail info are original
.
Equations
Instances For
Use the head atom/identifier of the current ref
as the ref
Equations
- Lean.withHeadRefOnly x = do let __do_lift ← Lean.getRef match Lean.Syntax.getHead? __do_lift with | none => x | some ref => Lean.withRef ref x
Instances For
Expand macros in the given syntax.
A node with kind k
is visited only if p k
is true.
Note that the default value for p
returns false for by ...
nodes.
This is a "hack". The tactic framework abuses the macro system to implement extensible tactics.
For example, one can define
syntax "my_trivial" : tactic -- extensible tactic
macro_rules | `(tactic| my_trivial) => `(tactic| decide)
macro_rules | `(tactic| my_trivial) => `(tactic| assumption)
When the tactic evaluator finds the tactic my_trivial
, it tries to evaluate the macro_rule
expansions
until one "works", i.e., the macro expansion is evaluated without producing an exception.
We say this solution is a bit hackish because the term elaborator may invoke expandMacros
with (p := fun _ => true)
,
and expand the tactic macros as just macros. In the example above, my_trivial
would be replaced with assumption
,
decide
would not be tried if assumption
fails at tactic evaluation time.
We are considering two possible solutions for this issue: 1- A proper extensible tactic feature that does not rely on the macro system.
2- Typed macros that know the syntax categories they're working in. Then, we would be able to select which
syntactic categories are expanded by expandMacros
.
Helper functions for processing Syntax programmatically #
Create an identifier copying the position from src
.
To refer to a specific constant, use mkCIdentFrom
instead.
Equations
- Lean.mkIdentFrom src val canonical = { raw := Lean.Syntax.ident (Lean.SourceInfo.fromRef src canonical) (String.toSubstring (toString val)) val [] }
Instances For
Equations
- Lean.mkIdentFromRef val canonical = do let __do_lift ← Lean.getRef pure (Lean.mkIdentFrom __do_lift val canonical)
Instances For
Create an identifier referring to a constant c
copying the position from src
.
This variant of mkIdentFrom
makes sure that the identifier cannot accidentally
be captured.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.mkCIdentFromRef c canonical = do let __do_lift ← Lean.getRef pure (Lean.mkCIdentFrom __do_lift c canonical).raw
Instances For
Equations
Instances For
Equations
- Lean.mkIdent val = { raw := Lean.Syntax.ident Lean.SourceInfo.none (String.toSubstring (toString val)) val [] }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.mkOptionalNode arg = match arg with | some arg => Lean.mkNullNode #[arg] | none => Lean.mkNullNode #[]
Instances For
Equations
- Lean.mkHole ref canonical = (Lean.mkNode `Lean.Parser.Term.hole #[Lean.mkAtomFrom ref "_" canonical]).raw
Instances For
Equations
- Lean.Syntax.mkSep a sep = Lean.mkNullNode (Lean.mkSepArray a sep)
Instances For
Equations
- Lean.Syntax.SepArray.ofElems elems = { elemsAndSeps := Lean.mkSepArray elems (if String.isEmpty sep = true then Lean.mkNullNode else Lean.mkAtom sep) }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.instCoeArraySyntaxSepArray = { coe := Lean.Syntax.SepArray.ofElems }
Constructs a typed separated array from elements. The given array does not include the separators.
Like Syntax.SepArray.ofElems
but for typed syntax.
Equations
- Lean.Syntax.TSepArray.ofElems elems = { elemsAndSeps := (Lean.Syntax.SepArray.ofElems (Lean.TSyntaxArray.raw elems)).elemsAndSeps }
Instances For
Equations
- Lean.Syntax.instCoeTSyntaxArrayTSepArray = { coe := Lean.Syntax.TSepArray.ofElems }
Create syntax representing a Lean term application, but avoid degenerate empty applications.
Equations
- Lean.Syntax.mkApp fn x = match x with | #[] => fn | args => { raw := (Lean.mkNode `Lean.Parser.Term.app #[fn.raw, Lean.mkNullNode (Lean.TSyntaxArray.raw args)]).raw }
Instances For
Equations
- Lean.Syntax.mkCApp fn args = Lean.Syntax.mkApp { raw := (Lean.mkCIdent fn).raw } args
Instances For
Equations
- Lean.Syntax.mkLit kind val info = let atom := Lean.Syntax.atom info val; Lean.mkNode kind #[atom]
Instances For
Equations
- Lean.Syntax.mkCharLit val info = Lean.Syntax.mkLit Lean.charLitKind (Char.quote val) info
Instances For
Equations
- Lean.Syntax.mkStrLit val info = Lean.Syntax.mkLit Lean.strLitKind (String.quote val) info
Instances For
Equations
- Lean.Syntax.mkNumLit val info = Lean.Syntax.mkLit Lean.numLitKind val info
Instances For
Equations
- Lean.Syntax.mkScientificLit val info = Lean.Syntax.mkLit Lean.scientificLitKind val info
Instances For
Equations
- Lean.Syntax.mkNameLit val info = Lean.Syntax.mkLit Lean.nameLitKind val info
Instances For
Recall that we don't have special Syntax constructors for storing numeric and string atoms.
The idea is to have an extensible approach where embedded DSLs may have new kind of atoms and/or
different ways of representing them. So, our atoms contain just the parsed string.
The main Lean parser uses the kind numLitKind
for storing natural numbers that can be encoded
in binary, octal, decimal and hexadecimal format. isNatLit
implements a "decoder"
for Syntax objects representing these numerals.
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
Instances For
Equations
Instances For
Decodes a 'scientific number' string which is consumed by the OfScientific
class.
Takes as input a string such as 123
, 123.456e7
and returns a triple (n, sign, e)
with value given by
n * 10^-e
if sign
else n * 10^e
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.isScientificLit? stx = match Lean.Syntax.isLit? Lean.scientificLitKind stx with | some val => Lean.Syntax.decodeScientificLitVal? val | x => none
Instances For
Equations
- Lean.Syntax.isIdOrAtom? x = match x with | Lean.Syntax.atom info val => some val | Lean.Syntax.ident info rawVal val preresolved => some (Substring.toString rawVal) | x => none
Instances For
Equations
- Lean.Syntax.toNat stx = match Lean.Syntax.isNatLit? stx with | some val => val | none => 0
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decodes a valid string gap after the \
.
Note that this function matches "\" whitespace+
rather than
the more restrictive "\" newline whitespace*
since this simplifies the implementation.
Justification: this does not overlap with any other sequences beginning with \
.
Equations
- Lean.Syntax.decodeStringGap s i = do guard (Char.isWhitespace (String.get s i) = true) some (String.nextWhile s Char.isWhitespace (String.next s i))
Instances For
Takes a raw string literal, counts the number of #
's after the r
, and interprets it as a string.
The position i
should start at 1
, which is the character after the leading r
.
The algorithm is simple: we are given r##...#"...string..."##...#
with zero or more #
s.
By counting the number of leading #
's, we can extract the ...string...
.
Takes the string literal lexical syntax parsed by the parser and interprets it as a string.
This is where escape sequences are processed for example.
The string s
is is either a plain string literal or a raw string literal.
If it returns none
then the string literal is ill-formed, which indicates a bug in the parser.
The function is not required to return none
if the string literal is ill-formed.
Equations
- Lean.Syntax.decodeStrLit s = if (String.get s 0 == 'r') = true then some (Lean.Syntax.decodeRawStrLitAux s { byteIdx := 1 } 0) else Lean.Syntax.decodeStrLitAux s { byteIdx := 1 } ""
Instances For
If the provided Syntax
is a string literal, returns the string it represents.
Even if the Syntax
is a str
node, the function may return none
if its internally ill-formed.
The parser should always create well-formed str
nodes.
Equations
- Lean.Syntax.isStrLit? stx = match Lean.Syntax.isLit? Lean.strLitKind stx with | some val => Lean.Syntax.decodeStrLit val | x => none
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.isCharLit? stx = match Lean.Syntax.isLit? Lean.charLitKind stx with | some val => Lean.Syntax.decodeCharLit val | x => none
Instances For
Split a name literal (without the backtick) into its dot-separated components. For example,
foo.bla.«bo.o»
↦ ["foo", "bla", "«bo.o»"]
. If the literal cannot be parsed, return []
.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.isNameLit? stx = match Lean.Syntax.isLit? Lean.nameLitKind stx with | some val => Lean.Syntax.decodeNameLit val | x => none
Instances For
Equations
- Lean.Syntax.hasArgs x = match x with | Lean.Syntax.node info kind args => decide (Array.size args > 0) | x => false
Instances For
Equations
- Lean.Syntax.isAtom x = match x with | Lean.Syntax.atom info val => true | x => false
Instances For
Equations
- Lean.Syntax.isToken token x = match x with | Lean.Syntax.atom info val => String.trim val == String.trim token | x => false
Instances For
Equations
- Lean.Syntax.isNone stx = match stx with | Lean.Syntax.node info k args => k == Lean.nullKind && Array.size args == 0 | Lean.Syntax.missing => true | x => false
Instances For
Equations
- Lean.Syntax.getOptionalIdent? stx = match Lean.Syntax.getOptional? stx with | some stx => some (Lean.Syntax.getId stx) | none => none
Instances For
Equations
- Lean.Syntax.find? stx p = Lean.Syntax.findAux p stx
Instances For
Equations
- Lean.TSyntax.getNat s = Option.getD (Lean.Syntax.isNatLit? s.raw) 0
Instances For
Equations
- Lean.TSyntax.getId s = Lean.Syntax.getId s.raw
Instances For
Equations
- Lean.TSyntax.getScientific s = Option.getD (Lean.Syntax.isScientificLit? s.raw) (0, false, 0)
Instances For
Equations
- Lean.TSyntax.getString s = Option.getD (Lean.Syntax.isStrLit? s.raw) ""
Instances For
Equations
- Lean.TSyntax.getChar s = Option.getD (Lean.Syntax.isCharLit? s.raw) default
Instances For
Equations
Instances For
Equations
- Lean.TSyntax.getHygieneInfo s = Lean.Syntax.getId s.raw[0]
Instances For
Equations
- Lean.TSyntax.Compat.instCoeTailArraySyntaxTSepArray = { coe := fun (a : Array Lean.Syntax) => Lean.Syntax.TSepArray.ofElems (Lean.TSyntaxArray.mk a) }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.instQuote = { quote := fun (a : α) => CoeHTCT.coe (Lean.quote a) }
Equations
- Lean.instQuoteTermMkStr1 = { quote := id }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.instQuoteCharCharLitKind = { quote := fun (val : Char) => Lean.Syntax.mkCharLit val }
Equations
- Lean.instQuoteStringStrLitKind = { quote := fun (val : String) => Lean.Syntax.mkStrLit val }
Equations
- Lean.instQuoteNatNumLitKind = { quote := fun (n : Nat) => Lean.Syntax.mkNumLit (toString n) }
Equations
- Lean.instQuoteSubstringMkStr1 = { quote := fun (s : Substring) => Lean.Syntax.mkCApp `String.toSubstring' #[Lean.quote (Substring.toString s)] }
Equations
- Lean.quoteNameMk Lean.Name.anonymous = { raw := (Lean.mkCIdent `Lean.Name.anonymous).raw }
- Lean.quoteNameMk (Lean.Name.str p s) = Lean.Syntax.mkCApp `Lean.Name.mkStr #[Lean.quoteNameMk p, Lean.quote s]
- Lean.quoteNameMk (Lean.Name.num p n) = Lean.Syntax.mkCApp `Lean.Name.mkNum #[Lean.quoteNameMk p, Lean.quote n]
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.instQuoteProdMkStr1 = { quote := fun (x : α × β) => match x with | (a, b) => Lean.Syntax.mkCApp `Prod.mk #[Lean.quote a, Lean.quote b] }
Equations
- Lean.instQuoteListMkStr1 = { quote := Lean.quoteList }
Equations
- Lean.instQuoteArrayMkStr1 = { quote := Lean.quoteArray }
Equations
- One or more equations did not get rendered due to their size.
Evaluator for prec
DSL
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.termEval_prec_ = Lean.ParserDescr.node `Lean.termEval_prec_ 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "eval_prec ") (Lean.ParserDescr.cat `prec 1024))
Instances For
Evaluator for prio
DSL
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.termEval_prio_ = Lean.ParserDescr.node `Lean.termEval_prio_ 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "eval_prio ") (Lean.ParserDescr.cat `prio 1024))
Instances For
Equations
- Lean.evalOptPrio x = match x with | some prio => Lean.evalPrio prio.raw | none => pure 1000
Instances For
Equations
Instances For
Equations
- Array.filterSepElemsM a p = Array.filterSepElemsMAux a p 0 #[]
Instances For
Equations
- Array.filterSepElems a p = Id.run (Array.filterSepElemsM a p)
Instances For
Equations
- Array.mapSepElemsM a f = Array.mapSepElemsMAux a f 0 #[]
Instances For
Equations
- Array.mapSepElems a f = Id.run (Array.mapSepElemsM a f)
Instances For
Equations
- Lean.Syntax.SepArray.getElems sa = Array.getSepElems sa.elemsAndSeps
Instances For
Equations
- Lean.Syntax.TSepArray.getElems sa = Lean.TSyntaxArray.mk (Array.getSepElems sa.elemsAndSeps)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.instCoeOutSepArrayArraySyntax = { coe := Lean.Syntax.SepArray.getElems }
Equations
- Lean.Syntax.instCoeOutTSepArrayTSyntaxArray = { coe := Lean.Syntax.TSepArray.getElems }
Equations
- Lean.Syntax.instCoeTSyntaxArray = { coe := fun (a : Lean.TSyntaxArray k) => Array.map Coe.coe a }
Equations
- Lean.Syntax.instCoeOutTSyntaxArrayArraySyntax = { coe := fun (a : Lean.TSyntaxArray k) => Lean.TSyntaxArray.raw a }
Equations
- Lean.Syntax.instCoeIdentTSyntaxConsSyntaxNodeKindMkStr4Nil = { coe := fun (id : Lean.Ident) => Lean.mkNode `Lean.Parser.Command.declId #[id.raw, Lean.mkNullNode #[]] }
Equations
- Lean.Syntax.instCoeTermTSyntaxConsSyntaxNodeKindMkStr4Nil = { coe := fun (stx : Lean.Term) => { raw := stx.raw } }
Helper functions for manipulating interpolated strings #
Equations
- Lean.Syntax.isInterpolatedStrLit? stx = match Lean.Syntax.isLit? Lean.interpolatedStrLitKind stx with | none => none | some val => Lean.Syntax.decodeInterpStrLit val
Instances For
Equations
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
- Lean.TSyntax.getDocString stx = match stx.raw[1] with | Lean.Syntax.atom info val => String.extract val 0 (String.endPos val - { byteIdx := 2 }) | x => ""
Instances For
Equations
- Lean.Meta.instReprConfig_1 = { reprPrec := Lean.Meta.reprConfig✝ }
Equations
- Lean.Meta.instReprTransparencyMode = { reprPrec := Lean.Meta.reprTransparencyMode✝ }
Equations
- Lean.Meta.instReprConfig = { reprPrec := Lean.Meta.reprConfig✝ }
Equations
- Lean.Meta.instReprEtaStructMode = { reprPrec := Lean.Meta.reprEtaStructMode✝ }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.Occurrences.isAll x = match x with | Lean.Meta.Occurrences.all => true | x => false
Instances For
- transparency : Lean.Meta.TransparencyMode
- offsetCnstrs : Bool
- occs : Lean.Meta.Occurrences
Instances For
Configures the behaviour of the omega
tactic.
- splitDisjunctions : Bool
Split disjunctions in the context.
Note that with
splitDisjunctions := false
omega will not be able to solvex = y
goals as these are usually handled by introducing¬ x = y
as a hypothesis, then replacing this withx < y ∨ x > y
.On the other hand,
omega
does not currently detect disjunctions which, when split, introduce no new useful information, so the presence of irrelevant disjunctions in the context can significantly increase run time. - splitNatSub : Bool
Whenever
((a - b : Nat) : Int)
is found, register the disjunctionb ≤ a ∧ ((a - b : Nat) : Int) = a - b ∨ a < b ∧ ((a - b : Nat) : Int) = 0
for later splitting. - splitNatAbs : Bool
Whenever
Int.natAbs a
is found, register the disjunction0 ≤ a ∧ Int.natAbs a = a ∨ a < 0 ∧ Int.natAbs a = - a
for later splitting. - splitMinMax : Bool
Whenever
min a b
ormax a b
is found, rewrite in terms of the definitionif a ≤ b ...
, for later case splitting.
Instances For
Type used to lift an arbitrary value into a type parameter so it can appear in a proof goal.
It is used by the #check_tactic command.
- intro: ∀ {α : Sort u} (val : α), Lean.Meta.CheckTactic.CheckGoalType val
Instances For
erw [rules]
is a shorthand for rw (config := { transparency := .default }) [rules]
.
This does rewriting up to unfolding of regular definitions (by comparison to regular rw
which only unfolds @[reducible]
definitions).
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.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
simp!
is shorthand for simp
with autoUnfold := true
.
This will rewrite with all equation lemmas, which can be used to
partially evaluate many definitions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
simp_arith
is shorthand for simp
with arith := true
and decide := true
.
This enables the use of normalization by linear arithmetic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
simp_arith!
is shorthand for simp_arith
with autoUnfold := true
.
This will rewrite with all equation lemmas, which can be used to
partially evaluate many definitions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
simp_all!
is shorthand for simp_all
with autoUnfold := true
.
This will rewrite with all equation lemmas, which can be used to
partially evaluate many definitions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
simp_all_arith
combines the effects of simp_all
and simp_arith
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
simp_all_arith!
combines the effects of simp_all
, simp_arith
and simp!
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
dsimp!
is shorthand for dsimp
with autoUnfold := true
.
This will rewrite with all equation lemmas, which can be used to
partially evaluate many definitions.
Equations
- One or more equations did not get rendered due to their size.