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 = (c.isAlpha || decide (c = '_') || Lean.isLetterLike c)
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Name.anonymous.getRoot = Lean.Name.anonymous
- (Lean.Name.anonymous.str str).getRoot = Lean.Name.anonymous.str str
- (Lean.Name.anonymous.num i).getRoot = Lean.Name.anonymous.num i
- (n.str str).getRoot = n.getRoot
- (n.num i).getRoot = n.getRoot
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.anonymous.str s) = Lean.Name.toStringWithSep.maybeEscape escape s
- Lean.Name.toStringWithSep sep escape (Lean.Name.anonymous.num v) = toString v
- Lean.Name.toStringWithSep sep escape (n.str s) = Lean.Name.toStringWithSep sep escape n ++ sep ++ Lean.Name.toStringWithSep.maybeEscape escape s
- Lean.Name.toStringWithSep sep escape (n.num v) = Lean.Name.toStringWithSep sep escape n ++ sep ++ v.repr
Instances For
Equations
- Lean.Name.toStringWithSep.maybeEscape escape s = if escape = true then (Lean.Name.escapePart s).getD s else s
Instances For
Equations
- Lean.Name.toString.maybePseudoSyntax n = match n.getRoot with | pre.str s => "#".isPrefixOf s || "?".isPrefixOf s | x => false
Instances For
Equations
- Lean.Name.instToString = { toString := fun (n : Lake.Name) => n.toString }
Equations
- One or more equations did not get rendered due to their size.
- Lean.Name.anonymous.reprPrec prec = Std.Format.text "Lean.Name.anonymous"
- (pre.num i).reprPrec prec = Repr.addAppParen (Std.Format.text "Lean.Name.mkNum " ++ pre.reprPrec 1024 ++ Std.Format.text " " ++ repr i) prec
Instances For
Equations
- Lean.Name.instRepr = { reprPrec := Lean.Name.reprPrec }
Equations
- x.capitalize = match x with | p.str s => p.str s.capitalize | n => n
Instances For
Equations
- Lean.Name.anonymous.replacePrefix Lean.Name.anonymous x = x
- Lean.Name.anonymous.replacePrefix x✝ x = Lean.Name.anonymous
- (p.str s).replacePrefix x✝ x = if (p.str s == x✝) = true then x else (p.replacePrefix x✝ x).mkStr s
- (p.num s).replacePrefix x✝ x = if (p.num s == x✝) = true then x else (p.replacePrefix x✝ x).mkNum s
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
Instances For
- getNGen : m Lean.NameGenerator
- setNGen : Lean.NameGenerator → m Unit
Instances
Equations
- Lean.mkFreshId = do let ngen ← Lean.getNGen let r : Lake.Name := ngen.curr Lean.setNGen ngen.next 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.instRepr = { 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.instCoeConsSyntaxNodeKindNil = { coe := fun (stx : Lean.TSyntax k) => { raw := stx.raw } }
Equations
- Lean.TSyntax.instCoeConsSyntaxNodeKind = { coe := fun (stx : Lean.TSyntax ks) => { raw := stx.raw } }
Equations
- Lean.TSyntax.instCoeIdentTerm = { coe := fun (s : Lean.Ident) => { raw := s.raw } }
Equations
- Lean.TSyntax.instCoeDepTermMkIdentIdent = { 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.instCoeTailSyntax = { 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.instBEq = { beq := Lean.Syntax.structEq }
Equations
- Lean.Syntax.instBEqTSyntax = { beq := fun (x x_1 : Lean.TSyntax k) => x.raw == x_1.raw }
Equations
- stx.getTailInfo = stx.getTailInfo?.getD Lean.SourceInfo.none
Instances For
Equations
- stx.getTrailingSize = match stx.getTailInfo? with | some (Lean.SourceInfo.original leading pos trailing endPos) => trailing.bsize | 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
- stx.setTailInfo info = match Lean.Syntax.setTailInfoAux info stx with | some stx => stx | none => stx
Instances For
Equations
- stx.unsetTrailing = match stx.getTailInfo with | Lean.SourceInfo.original lead pos trailing endPos => stx.setTailInfo (Lean.SourceInfo.original lead pos "".toSubstring endPos) | x => stx
Instances For
Equations
- stx.setHeadInfo 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
- target.copyHeadTailInfoFrom source = (target.setHeadInfo source.getHeadInfo).setTailInfo source.getTailInfo
Instances For
Ensure head position is synthetic. The server regards syntax as "original" only if both head and tail info are original
.
Equations
- stx.mkSynthetic = stx.setHeadInfo (Lean.SourceInfo.fromRef stx)
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 __do_lift.getHead? 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) (toString val).toSubstring 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 (toString val).toSubstring 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 sep.isEmpty = 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.instCoeArraySepArray = { 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 args.raw]).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 val.quote info
Instances For
Equations
- Lean.Syntax.mkStrLit val info = Lean.Syntax.mkLit Lean.strLitKind val.quote 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
- s.isNatLit? = Lean.Syntax.isNatLitAux Lean.numLitKind s
Instances For
Equations
- s.isFieldIdx? = Lean.Syntax.isNatLitAux Lean.fieldIdxKind s
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
- stx.isScientificLit? = match Lean.Syntax.isLit? Lean.scientificLitKind stx with | some val => Lean.Syntax.decodeScientificLitVal? val | x => none
Instances For
Equations
- x.isIdOrAtom? = match x with | Lean.Syntax.atom info val => some val | Lean.Syntax.ident info rawVal val preresolved => some rawVal.toString | x => none
Instances For
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 ((s.get i).isWhitespace = true) some (s.nextWhile Char.isWhitespace (s.next 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 (s.get 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
- stx.isStrLit? = 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
- stx.isCharLit? = 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
- Lean.Syntax.splitNameLit ss = (Lean.Syntax.splitNameLitAux ss []).reverse
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Syntax.decodeNameLit s = if (s.get 0 == '`') = true then match (s.toSubstring.drop 1).toName with | Lean.Name.anonymous => none | name => some name else none
Instances For
Equations
- stx.isNameLit? = match Lean.Syntax.isLit? Lean.nameLitKind stx with | some val => Lean.Syntax.decodeNameLit val | x => none
Instances For
Equations
- x.hasArgs = match x with | Lean.Syntax.node info kind args => decide (args.size > 0) | x => false
Instances For
Equations
- x.isAtom = 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 => val.trim == token.trim | x => false
Instances For
Equations
- stx.isNone = match stx with | Lean.Syntax.node info k args => k == Lean.nullKind && args.size == 0 | Lean.Syntax.missing => true | x => false
Instances For
Equations
Instances For
Equations
- stx.find? p = Lean.Syntax.findAux p stx
Instances For
Equations
- Lean.TSyntax.getNat s = s.raw.isNatLit?.getD 0
Instances For
Equations
- Lean.TSyntax.getId s = s.raw.getId
Instances For
Equations
- Lean.TSyntax.getScientific s = s.raw.isScientificLit?.getD (0, false, 0)
Instances For
Equations
- Lean.TSyntax.getString s = s.raw.isStrLit?.getD ""
Instances For
Equations
- Lean.TSyntax.getChar s = s.raw.isCharLit?.getD default
Instances For
Equations
- Lean.TSyntax.getName s = s.raw.isNameLit?.getD Lean.Name.anonymous
Instances For
Equations
- Lean.TSyntax.getHygieneInfo s = s.raw[0].getId
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.instQuoteOfCoeHTCTTSyntaxConsSyntaxNodeKindNil = { 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 s.toString] }
Equations
- Lean.quoteNameMk Lean.Name.anonymous = { raw := (Lean.mkCIdent `Lean.Name.anonymous).raw }
- Lean.quoteNameMk (p.str s) = Lean.Syntax.mkCApp `Lean.Name.mkStr #[Lean.quoteNameMk p, Lean.quote s]
- Lean.quoteNameMk (p.num 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
- a.filterSepElemsM p = Array.filterSepElemsMAux a p 0 #[]
Instances For
Equations
- a.filterSepElems p = (a.filterSepElemsM p).run
Instances For
Equations
- a.mapSepElemsM f = Array.mapSepElemsMAux a f 0 #[]
Instances For
Equations
- a.mapSepElems f = (a.mapSepElemsM f).run
Instances For
Equations
- sa.getElems = sa.elemsAndSeps.getSepElems
Instances For
Equations
- sa.getElems = Lean.TSyntaxArray.mk sa.elemsAndSeps.getSepElems
Instances For
Equations
- sa.push e = if sa.elemsAndSeps.isEmpty = true then { elemsAndSeps := #[e.raw] } else { elemsAndSeps := (sa.elemsAndSeps.push (Lean.mkAtom sep)).push e.raw }
Instances For
Equations
- Lean.Syntax.instCoeOutSepArrayArray = { coe := Lean.Syntax.SepArray.getElems }
Equations
- Lean.Syntax.instCoeOutTSepArrayTSyntaxArray = { coe := Lean.Syntax.TSepArray.getElems }
Equations
- Lean.Syntax.instCoeTSyntaxArrayOfTSyntax = { coe := fun (a : Lean.TSyntaxArray k) => Array.map Coe.coe a }
Equations
- Lean.Syntax.instCoeOutTSyntaxArrayArray = { coe := fun (a : Lean.TSyntaxArray k) => a.raw }
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
- stx.isInterpolatedStrLit? = match Lean.Syntax.isLit? Lean.interpolatedStrLitKind stx with | none => none | some val => Lean.Syntax.decodeInterpStrLit val
Instances For
Equations
- stx.getSepArgs = stx.getArgs.getSepElems
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
- stx.getDocString = match stx.raw[1] with | Lean.Syntax.atom info val => val.extract 0 (val.endPos - { byteIdx := 2 }) | x => ""
Instances For
Equations
- Lean.Meta.instReprConfig_1 = { reprPrec := Lean.Meta.reprConfig✝ }
Equations
- Lean.Meta.instReprConfig = { reprPrec := Lean.Meta.reprConfig✝ }
Equations
- Lean.Meta.instReprEtaStructMode = { reprPrec := Lean.Meta.reprEtaStructMode✝ }
Equations
- Lean.Meta.instReprTransparencyMode = { reprPrec := Lean.Meta.reprTransparencyMode✝ }
Equations
- x✝.contains x = match x✝, x with | Lean.Meta.Occurrences.all, x => true | Lean.Meta.Occurrences.pos idxs, idx => idxs.contains idx | Lean.Meta.Occurrences.neg idxs, idx => !idxs.contains idx
Instances For
Equations
- x.isAll = 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.