Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Output
Description
Defines the structure of the training data, as well as how to translate internal Agda definition to this format.
Synopsis
- type Name = String
- type DB = Int
- type Head = Either Name DB
- pattern (:>) :: String -> a -> Pretty a
- data Pretty a = Pretty {}
- data Reduced a = Reduced {
- original :: a
- simplified :: Maybe a
- reduced :: Maybe a
- normalised :: Maybe a
- pattern (:~) :: Name -> a -> Named a
- data Named a = Named {}
- type FileData = Named TrainData
- data TrainData = TrainData {
- scopeGlobal :: [ScopeEntry]
- scopeLocal :: [ScopeEntry]
- scopePrivate :: Maybe [ScopeEntry]
- type ScopeEntry = Named ScopeEntry'
- data ScopeEntry' = ScopeEntry {}
- data Sample = Sample {}
- data Definition
- data Clause = Clause {}
- type Telescope = [Named (Pretty Type)]
- type Pattern = Term
- type Type = Term
- data Term
- class a ~> b | a -> b where
- pp :: Pretty a => a -> String
- ppm :: (MonadPretty m, PrettyTCM a) => a -> m Doc
- prender :: Doc -> String
- pinterleave :: (Applicative m, Semigroup (m Doc)) => m Doc -> [m Doc] -> m Doc
- pbindings :: (MonadPretty m, PrettyTCM a) => [(String, a)] -> [m Doc]
- report :: MonadTCM m => VerboseLevel -> TCM Doc -> m ()
- panic :: (Pretty a, Show a) => String -> a -> b
- ppName :: QName -> String
- unqualify :: QName -> String
- (\/) :: (a -> Bool) -> (a -> Bool) -> a -> Bool
- isNotCubical :: Clause -> Bool
- jsonOpts :: Options
Types
type Head = Either Name DB Source #
A head of a λ-application can either be a defined name in the global scope, or a DeBruijn index into the local context.
Generic constructions
Bundle a thing with its "pretty" version.
NB: In JSON format, we follow a shallow encoding with "pretty" being an additional field and "thing" just inlined in the top-level record.
Instances
Telescope ~> Telescope Source # | |
FromJSON a => FromJSON (Pretty a) Source # | |
ToJSON a => ToJSON (Pretty a) Source # | |
Generic (Pretty a) Source # | |
Show a => Show (Pretty a) Source # | |
type Rep (Pretty a) Source # | |
Defined in Output type Rep (Pretty a) = D1 ('MetaData "Pretty" "Output" "agda2train-0.0.3.0-inplace-agda2train-lib" 'False) (C1 ('MetaCons "Pretty" 'PrefixI 'True) (S1 ('MetaSel ('Just "pretty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "thing") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
Bundle a term with (several of) its normalised forms.
We do not repeat identical elements in subsequent evaluations (in the order simprednorm) and some fields may not be populated due to the evaluation taking to long and leading to a timeout (currently 2 seconds).
NB: Like Named
, encoded in a shallow JSON.
Constructors
Reduced | |
Fields
|
Instances
Instances
Telescope ~> Telescope Source # | |
FromJSON a => FromJSON (Named a) Source # | |
ToJSON a => ToJSON (Named a) Source # | |
Generic (Named a) Source # | |
Show a => Show (Named a) Source # | |
type Rep (Named a) Source # | |
Defined in Output type Rep (Named a) = D1 ('MetaData "Named" "Output" "agda2train-0.0.3.0-inplace-agda2train-lib" 'False) (C1 ('MetaCons "Named" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Just "item") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
Concrete types (~ JSON schema)
The training data for a module, divided into three parts.
Constructors
TrainData | |
Fields
|
Instances
FromJSON TrainData Source # | |
ToJSON TrainData Source # | |
Generic TrainData Source # | |
type Rep TrainData Source # | |
Defined in Output type Rep TrainData = D1 ('MetaData "TrainData" "Output" "agda2train-0.0.3.0-inplace-agda2train-lib" 'False) (C1 ('MetaCons "TrainData" 'PrefixI 'True) (S1 ('MetaSel ('Just "scopeGlobal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ScopeEntry]) :*: (S1 ('MetaSel ('Just "scopeLocal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ScopeEntry]) :*: S1 ('MetaSel ('Just "scopePrivate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [ScopeEntry]))))) |
type ScopeEntry = Named ScopeEntry' Source #
Every ScopeEntry'
is named.
data ScopeEntry' Source #
An entry in the scope: type, definitions, and holes.
Constructors
ScopeEntry | |
Fields
|
Instances
The training sample for each sub-hole.
Constructors
Sample | |
Fields
|
Instances
FromJSON Sample Source # | |
ToJSON Sample Source # | |
Generic Sample Source # | |
Show Sample Source # | |
type Rep Sample Source # | |
Defined in Output type Rep Sample = D1 ('MetaData "Sample" "Output" "agda2train-0.0.3.0-inplace-agda2train-lib" 'False) (C1 ('MetaCons "Sample" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ctx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pretty Telescope)) :*: S1 ('MetaSel ('Just "goal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pretty (Reduced Type)))) :*: (S1 ('MetaSel ('Just "term") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pretty (Reduced Term))) :*: S1 ('MetaSel ('Just "premises") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Name])))) |
data Definition Source #
Agda definitions: datatypes, records, functions, postulates and primitives.
Constructors
ADT | e.g. data ℕ : Set where zero : ℕ suc : ℕ → ℕ |
Constructor | e.g. `(ℕ, 0) ~ zero` or `(ℕ, 1) ~ suc` |
Record | e.g. record X : Set where field x : ℕ y : ℕ |
Function | e.g. f [] = [] f (x ∷ xs) = x ∷ x ∷ xs |
Postulate | e.g. `postulate pred : ℕ → ℕ` |
Primitive | e.g. `primitive primShowNat : ℕ → String` |
Instances
Function clauses.
Constructors
Clause | |
Instances
FromJSON Clause Source # | |
ToJSON Clause Source # | |
Generic Clause Source # | |
Show Clause Source # | |
Clause ~> Clause Source # | |
type Rep Clause Source # | |
Defined in Output type Rep Clause = D1 ('MetaData "Clause" "Output" "agda2train-0.0.3.0-inplace-agda2train-lib" 'False) (C1 ('MetaCons "Clause" 'PrefixI 'True) (S1 ('MetaSel ('Just "_telescope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Telescope) :*: (S1 ('MetaSel ('Just "patterns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Pattern]) :*: S1 ('MetaSel ('Just "body") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Term))))) |
type Telescope = [Named (Pretty Type)] Source #
A telescope is a sequence of (named) types, a.k.a. bindings.
We under-approximate patterns as terms, e.g. losing information about forced patterns.
The AST of Agda terms.
Constructors
Pi Bool (Named Term) Term | e.g. |
Lam (Named Term) | e.g. |
App Head [Term] | e.g. |
Lit String | e.g. |
Sort String | e.g. |
Level String | e.g. |
UnsolvedMeta | i.e. |
Instances
Conversion from Agda's internal syntax
class a ~> b | a -> b where Source #
Converting between two types a
and b
under Agda's typechecking monad.
NB: go
is only used internally to de-clutter the recursive calls.
Minimal complete definition
Instances
Clause ~> Clause Source # | |
DeBruijnPattern ~> Pattern Source # | |
Elim ~> Term Source # | |
Telescope ~> Telescope Source # | |
Term ~> Term Source # | |
Type ~> Type Source # | |
Definition ~> Definition Source # | |
Defined in Output Methods convert :: Definition0 -> TCM Definition Source # go :: Definition0 -> TCM Definition Source # | |
Defn ~> Definition Source # | |
Utilities
pinterleave :: (Applicative m, Semigroup (m Doc)) => m Doc -> [m Doc] -> m Doc Source #
isNotCubical :: Clause -> Bool Source #
Configure JSON to omit empty (optional) fields and switch from camelCase to kebab-case.
Orphan instances
PrettyTCM Definition Source # | |
Methods prettyTCM :: MonadPretty m => Definition -> m Doc # |