Coverage report: /home/runner/work/geb/geb/src/generics/generics.lisp
Kind | Covered | All | % |
expression | 0 | 13 | 0.0 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
(in-package :geb.generics)
3
(defgeneric gapply (morphism object)
4
(:documentation "Applies a given Moprhism to a given object.
6
This is practically a naive interpreter for any category found
7
throughout the codebase.
9
Some example usages of GAPPLY are.
15
(->right so1 geb-bool:bool))
21
(->right so1 geb-bool:bool))
26
(defgeneric well-defp-cat (morphism)
27
(:documentation "Given a moprhism of a category, checks that
28
it is well-defined. E.g. that composition of morphism is
29
well-defined by checking that the domain of MCAR corresponds
30
to the codomain of MCADR"))
32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
37
(defgeneric maybe (object)
39
"Wraps the given OBJECT into a Maybe monad The Maybe monad in this
40
case is simply wrapping the term in a [coprod][geb.spec:coprod]
41
of [so1][geb.spec:so1]"))
43
(defgeneric so-hom-obj (object1 object2)
45
"Takes in X and Y Geb objects and provides an internal hom-object
46
(so-hom-obj X Y) representing a set of functions from X to Y"))
48
(defgeneric so-eval (object1 object2)
50
"Takes in X and Y Geb objects and provides an evaluation morphism
51
(prod (so-hom-obj X Y) X) -> Y"))
53
(defgeneric width (object)
55
"Given an OBJECT of Geb presents it as a SeqN object. That is,
56
width corresponds the object part of the to-seqn functor."))
58
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59
;; Conversion functions
60
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
62
(defgeneric to-bitc (morphism)
64
"Turns a given MORPHISM into a [GEB.BITC.SPEC:BITC]"))
66
(defgeneric to-poly (morphism)
68
"Turns a given MORPHISM into a [GEB.POLY.SPEC:POLY]"))
70
(defgeneric to-seqn (morphism)
72
"Turns a given MORPHISM into a [GEB.SEQN.SPEC:SEQN]"))
74
(defgeneric to-circuit (morphism name)
76
"Turns a MORPHISM into a Vampir circuit. the NAME is the given name of
77
the output circuit."))
79
(defgeneric to-vampir (morphism values constraints)
81
"Turns a MORPHISM into a Vampir circuit, with concrete values.
83
The more natural interface is [TO-CIRCUIT], however this is a more low
84
level interface into what the polynomial categories actually
85
implement, and thus can be extended or changed.
87
The VALUES are likely vampir values in a list.
89
The CONSTRAINTS represent constraints that get creating"))
91
(defgeneric to-cat (context term)
93
"Turns a MORPHISM with a context into Geb's Core category"))