Idris2Doc : Algebra.Solver.Monoid

Algebra.Solver.Monoid

(source)

Reexports

importpublic Algebra.Group
importpublic Algebra.Solver.Ops
importpublic Data.List.Elem

Definitions

dataExpr : (a : Type) ->Lista->Type
  Tree representing an algebraic expression in a monoid structure.

The idea here is to represent algebraic expressions as an `Expr a as`,
where `a` is the type we operate on and `as` is a list of known
variables. Such an `Expr a as` can then be normalized using function
`normalize`. We proof in this module, that the result of evaluating an
expression is not affected by normalization. Hence, if two expressions
`e1` and `e2` have the same normalized representation, the results
of evaluating the two (`eval e1` and `eval e2`) are propositionally
equal. This is, what function `solve` is used for.

Totality: total
Visibility: public export
Constructors:
Lit : a->Expraas
  A literal value known at compile time. Use this if you want
values known at runtime to unify.
Var : (x : a) ->Elemxas->Expraas
  A variable from the given list of variables.
Neutral : Expraas
  Represents the neutral element of the monoid
(<+>) : Expraas->Expraas->Expraas
  Represents the binary operation of the monoid
dataTerm : (a : Type) ->Lista->Type
  An `Expr a as` is normalized to a sequence of terms of type
`List (Term a as)`.

Totality: total
Visibility: public export
Constructors:
TLit : a->Termaas
TVar : (x : a) ->Elemxas->Termaas
var : (x : a) ->Elemxxs=>Expraxs
  Alias for `var` that uses an auto-implicit proof of `Elem x xs`.

Totality: total
Visibility: public export
(.+>) : (x : a) ->Expraxs->Elemxxs=>Expraxs
  Alias for `var x <+> y`

Totality: total
Visibility: public export
Fixity Declaration: infixl operator, level 8
(<+.) : Expraxs-> (x : a) ->Elemxxs=>Expraxs
  Alias for `x <+> var y`

Totality: total
Visibility: public export
Fixity Declaration: infixl operator, level 8
(.+.) : (x : a) -> (y : a) ->Elemxxs=>Elemyxs=>Expraxs
  Alias for `var x .+. var y`

Totality: total
Visibility: public export
Fixity Declarations:
infixl operator, level 8
infixl operator, level 8
eval : (0_ : Monoidazp) ->Expraas->a
  Evaluates an expression over the given monoid.
Note: The idea is to use this function at compile-time to
convert the expression we evaluate to the corresponding
Idris expression.

Totality: total
Visibility: public export
eterm : Termaas->a
  Evaluates a single term.

Totality: total
Visibility: public export
elist : (0_ : Monoidazp) ->List (Termaas) ->a
  Evaluates a list of terms over the given monoid.

Totality: total
Visibility: public export
flatten : Expraas->List (Termaas)
  Flattens an expression into a list of terms

Totality: total
Visibility: public export
fuse : (0_ : Monoidazp) -> ((v : a) ->Maybe (v=z)) ->Termaas->Termaas->List (Termaas)
  Tries to fuse two neighbouring terms

Totality: total
Visibility: public export
prepend : (0_ : Monoidazp) -> ((v : a) ->Maybe (v=z)) ->List (Termaas) ->Termaas->List (Termaas)
  Prepends a single term in front of a list of terms.
This will remove terms that evaluate to zero and
fuse neighbouring literals.

Totality: total
Visibility: public export
merge : (0_ : Monoidazp) -> ((v : a) ->Maybe (v=z)) ->List (Termaas) ->List (Termaas)
Totality: total
Visibility: public export
normalize : (0_ : Monoidazp) -> ((v : a) ->Maybe (v=z)) ->Expraas->List (Termaas)
Totality: total
Visibility: public export
0solve : (m : Monoidazp) -> (isZ : ((x : a) ->Maybe (x=z))) -> (e1 : Expraas) -> (e2 : Expraas) ->normalizemisZe1=normalizemisZe2=>evalme1=evalme2
Totality: total
Visibility: export