Documentation ¶
Index ¶
- func CleanUp(u cir.Circuit) cir.Circuit
- func DontCognize(interface{})
- func IsIndex(v cir.Value) bool
- func Link(x, y *Synapse)
- func Materialize(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) interface{}
- func MaterializeInstance(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) (residue, obj interface{})
- func MaterializeSource(given Reflex, matter cir.Circuit, v interface{}) cir.Value
- func MaterializeSystem(system interface{}, index, barrier cir.Circuit) (residue interface{})
- func Panicf(f string, a ...interface{})
- func PrintMatter(w io.Writer, matter cir.Circuit)
- func PrintView(u cir.Circuit) string
- func PrintableMatter(u cir.Circuit) string
- func SinkValue(v interface{})
- func SummarizeIndex(matter cir.Circuit) string
- type Cognize
- type Entanglement
- type Eye
- type EyeCognizer
- type Future
- type Index
- type Material
- type Materializer
- type Panic
- type ReCognizer
- type Reflex
- type Sparkless
- type Synapse
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUp ¶
CleanUp removes nil-valued gates and their incident edges. CleanUp never returns nil.
func Materialize ¶
Materialize materializes the native implementation v. It returns the resulting reflex and residue, but not the Go-facing instance.
func MaterializeInstance ¶
func MaterializeInstance(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) (residue, obj interface{})
MaterializeInstance materializes the native implementation v. It returns the resulting reflex and residue, as well as the Go-facing instance.
func MaterializeSource ¶
func MaterializeSystem ¶
func PrintableMatter ¶
func SummarizeIndex ¶
Types ¶
type Cognize ¶
type Cognize func(value interface{})
Cognize routines are called when a change in value is to be delivered to a reflex.
type Entanglement ¶
func NewEntanglement ¶
func NewEntanglement() (p, n *Entanglement)
NewEntanglement returns two materializers that each materialize once, to a gate with a default valve which is connected to the other.
func (*Entanglement) Materialize ¶
func (*Entanglement) Synapse ¶
func (em *Entanglement) Synapse() *Synapse
type Eye ¶
type Eye struct {
// contains filtered or unexported fields
}
Eye is a runtime facility that delivers messages by invoking gate methods and provides methods that the gate can use to send messages out.
Eye is an implementation of Leslie Valiant's “Mind's Eye”, described in the book:
Probably Approximately Correct - Nature's Algorithms for Learning and Prospering in a Complex World PDF: https://dl.acm.org/doi/book/10.5555/2536711 It is a book about some basic concepts for Machine Learning from 1984.
The mind's eye is a synchronization device which sees changes as ordered and thus introduces the illusory perception of time (and, eventually, of the higher-level concepts of cause and effect).
func (*Eye) Connect ¶
func (eye *Eye) Connect(given Reflex, cog EyeCognizer)
type EyeCognizer ¶
type Index ¶
Index is a hierarchy of names with associated meanings. Alternatively, it is a key-value store wherein keys are sequences of names.
type Material ¶
type Material interface {
Spark(eye *Eye, matter cir.Circuit, aux ...interface{}) cir.Value // Initializer
}
Material represents a materializable object implemented as a Go type.
type Materializer ¶
func NewMaterializer ¶
func NewMaterializer(sample Material, aux ...interface{}) Materializer
NewMaterializer returns a materializer that generates copies of sample and sparks them with the aux data.
func NewSink ¶
func NewSink() Materializer
func NewSource ¶
func NewSource(v interface{}) Materializer
type ReCognizer ¶
type ReCognizer struct {
// contains filtered or unexported fields
}
The two endpoints of a Synapse are ReCognizer objects.
func (*ReCognizer) ReCognize ¶
func (s *ReCognizer) ReCognize(value interface{})
ReCognize sends value to the reciprocal side of this synapse.
type Synapse ¶
Synapse is the “wire” connecting two reflexes. It remembers the last value transmitted in order to stop propagation of same-value messages.
func NewSynapse ¶
func NewSynapse() (x, y *Synapse)
func (*Synapse) Connect ¶
func (m *Synapse) Connect(cognize Cognize) *ReCognizer