Documentation

Lean.Structure

Instances For
    Instances For
      Instances For

        Get direct field names for the given structure.

        Instances For
          Instances For

            If fieldName represents the relation to a parent structure S, return S

            Instances For

              Return immediate parent structures

              Instances For

                Return all parent structures

                Instances For
                  partial def Lean.findField? (env : Lean.Environment) (structName : Lake.Name) (fieldName : Lake.Name) :

                  findField? env S fname. If fname is defined in a parent S' of S, return S'

                  def Lean.getStructureFieldsFlattened (env : Lean.Environment) (structName : Lake.Name) (includeSubobjectFields : optParam Bool true) :

                  Return field names for the given structure, including "flattened" fields from parent structures. To omit toParent projections, set includeSubobjectFields := false.

                  For example, given Bar such that

                  structure Foo where a : Nat
                  structure Bar extends Foo where b : Nat
                  

                  return #[toFoo,a,b] or #[a,b] with subobject fields omitted.

                  Instances For
                    def Lean.isStructure (env : Lean.Environment) (constName : Lake.Name) :

                    Return true if constName is the name of an inductive datatype created using the structure or class commands.

                    We perform the check by testing whether auxiliary projection functions have been created.

                    Instances For
                      Instances For
                        Instances For
                          partial def Lean.getPathToBaseStructureAux (env : Lean.Environment) (baseStructName : Lake.Name) (structName : Lake.Name) (path : List Lake.Name) :
                          def Lean.getPathToBaseStructure? (env : Lean.Environment) (baseStructName : Lake.Name) (structName : Lake.Name) :

                          If baseStructName is an ancestor structure for structName, then return a sequence of projection functions to go from structName to baseStructName.

                          Instances For

                            Return true iff constName is the a non-recursive inductive datatype that has only one constructor.

                            Instances For

                              Return number of fields for a structure-like type

                              Instances For