Equations
- One or more equations did not get rendered due to their size.
Instances For
Expand field abbreviations. Example: { x, y := 0 }
expands to { x := x, y := 0 }
Equations
- One or more equations did not get rendered due to their size.
Instances For
- stx : Lean.Syntax
- structName : Lake.Name
Instances For
Equations
- Lean.Elab.Term.StructInst.instInhabitedExplicitSourceInfo = { default := { stx := default, structName := default } }
- implicit : Option Lean.Syntax
Instances For
Equations
- Lean.Elab.Term.StructInst.instInhabitedSource = { default := { explicit := default, implicit := default } }
Instances For
- fieldName: Lean.Syntax → Lake.Name → Lean.Elab.Term.StructInst.FieldLHS
- fieldIndex: Lean.Syntax → Nat → Lean.Elab.Term.StructInst.FieldLHS
- modifyOp: Lean.Syntax → Lean.Syntax → Lean.Elab.Term.StructInst.FieldLHS
Instances For
Equations
- Lean.Elab.Term.StructInst.instInhabitedFieldLHS = { default := Lean.Elab.Term.StructInst.FieldLHS.fieldName default default }
Equations
- One or more equations did not get rendered due to their size.
- term: {σ : Type} → Lean.Syntax → Lean.Elab.Term.StructInst.FieldVal σ
- nested: {σ : Type} → σ → Lean.Elab.Term.StructInst.FieldVal σ
- default: {σ : Type} → Lean.Elab.Term.StructInst.FieldVal σ
Instances For
Equations
- Lean.Elab.Term.StructInst.instInhabitedFieldVal = { default := Lean.Elab.Term.StructInst.FieldVal.term default }
- ref : Lean.Syntax
Instances For
Equations
- Lean.Elab.Term.StructInst.instInhabitedField = { default := { ref := default, lhs := default, val := default, expr? := default } }
Equations
Instances For
- mk: Lean.Syntax →
Lake.Name →
Array (Lake.Name × Lean.Expr) →
List (Lean.Elab.Term.StructInst.Field Lean.Elab.Term.StructInst.Struct) →
Lean.Elab.Term.StructInst.Source → Lean.Elab.Term.StructInst.Struct
Remark: the field
params
is use for default value propagation. It is initially empty, and then set atelabStruct
.
Instances For
Equations
- Lean.Elab.Term.StructInst.instInhabitedStruct = { default := Lean.Elab.Term.StructInst.Struct.mk default default default default default }
Equations
Instances For
Equations
- (Lean.Elab.Term.StructInst.Struct.mk ref structName params fields source).ref = ref
Instances For
Equations
- (Lean.Elab.Term.StructInst.Struct.mk ref structName params fields source).structName = structName
Instances For
Equations
- (Lean.Elab.Term.StructInst.Struct.mk ref structName params fields source).params = params
Instances For
Equations
- (Lean.Elab.Term.StructInst.Struct.mk ref structName params fields source).fields = fields
Instances For
Equations
- (Lean.Elab.Term.StructInst.Struct.mk ref structName params fields source).source = source
Instances For
true
iff all fields of the given structure are marked as default
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Term.StructInst.instToStringStruct = { toString := toString ∘ Lean.format }
Equations
- Lean.Elab.Term.StructInst.instToStringFieldStruct = { toString := toString ∘ Lean.format }
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.Term.StructInst.FieldLHS.toSyntax first (Lean.Elab.Term.StructInst.FieldLHS.modifyOp stx index) = stx
- Lean.Elab.Term.StructInst.FieldLHS.toSyntax first (Lean.Elab.Term.StructInst.FieldLHS.fieldIndex stx idx) = if first = true then stx else Lean.mkGroupNode #[Lean.mkAtomFrom stx ".", stx]
Instances For
Equations
- (Lean.Elab.Term.StructInst.FieldVal.term stx).toSyntax = stx
- x.toSyntax = panicWithPosWithDecl "Lean.Elab.StructInst" "Lean.Elab.Term.StructInst.FieldVal.toSyntax" 336 25 "unreachable code has been reached"
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
- s.modifyFields f = (s.modifyFieldsM f).run
Instances For
Equations
- s.setFields fields = s.modifyFields fun (x : Lean.Elab.Term.StructInst.Fields) => fields
Instances For
Equations
- (Lean.Elab.Term.StructInst.Struct.mk ref structName params fields source).setParams ps = Lean.Elab.Term.StructInst.Struct.mk ref structName ps fields source
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.Elab.Term.StructInst.markDefaultMissing e = Lean.mkAnnotation `structInstDefault e
Instances For
Equations
- Lean.Elab.Term.StructInst.defaultMissing? e = Lean.annotation? `structInstDefault e
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
- val : Lean.Expr
- struct : Lean.Elab.Term.StructInst.Struct
- instMVars : Array Lean.MVarId
Instances For
- structs : Array Lean.Elab.Term.StructInst.Struct
- maxDistance : Nat
Consider the following example:
structure A where x : Nat := 1 structure B extends A where y : Nat := x + 1 x := y + 1 structure C extends B where z : Nat := 2*y x := z + 3
And we are trying to elaborate a structure instance for
C
. There are default values forx
atA
,B
, andC
. We say the default value atC
has distance 0, the one atB
distance 1, and the one atA
distance 2. The fieldmaxDistance
specifies the maximum distance considered in a round of Default field computation. Remark: sinceC
does not set a default value ofy
, the default value atB
is at distance 0.The fixpoint for setting default values works in the following way.
- Keep computing default values using
maxDistance == 0
. - We increase
maxDistance
whenever we failed to compute a new default value in a round. - If
maxDistance > 0
, then we interrupt a round as soon as we compute some default value. We use depth-first search. - We sign an error if no progress is made when
maxDistance
== structure hierarchy depth (2 in the example above).
- Keep computing default values using
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Elab.Term.StructInst.DefaultFields.allDefaultMissing struct = (SeqRight.seqRight (Lean.Elab.Term.StructInst.DefaultFields.allDefaultMissing.go struct) fun (x : Unit) => get).run' #[]
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
- One or more equations did not get rendered due to their size.
Instances For
Reduce default value. It performs beta reduction and projections of the given structures.
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.