Idris2Doc : Algebra.Solver.Semigroup

Algebra.Solver.Semigroup

(source)

Reexports

importpublic Algebra.Group
importpublic Algebra.Solver.Ops
importpublic Data.List1

Definitions

dataExpr : (a : Type) ->Lista->Type
  Tree representing an algebraic expression in a semigroup 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.
(<+>) : 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_ : Semigroupap) ->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_ : Semigroupap) ->Termaas->List (Termaas) ->a
  Evaluates a list of terms over the given Semigroup.

Totality: total
Visibility: public export
elist1 : (0_ : Semigroupap) ->List1 (Termaas) ->a
  Evaluates a non-empty list of terms over the given Semigroup.

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

Totality: total
Visibility: public export
prepend : (0_ : Semigroupap) ->List1 (Termaas) ->Termaas->List1 (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_ : Semigroupap) ->Termaas->List (Termaas) ->List1 (Termaas)
Totality: total
Visibility: public export
merge1 : (0_ : Semigroupap) ->List1 (Termaas) ->List1 (Termaas)
Totality: total
Visibility: public export
normalize : (0_ : Semigroupap) ->Expraas->List1 (Termaas)
Totality: total
Visibility: public export
0solve : (s : Semigroupap) -> (e1 : Expraas) -> (e2 : Expraas) ->normalizese1=normalizese2=>evalse1=evalse2
Totality: total
Visibility: export