Documentation
¶
Overview ¶
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.
Index ¶
- Constants
- func CalcKeys[K comparable](u any) []K
- func ClearTableIdx()
- func GetClass(bs []byte) string
- func GetTableIdx(table string) (int, bool)
- func GetTableName(idx int) (string, bool)
- func MkFacts() ([]*person, []*flight, []*airport, []*country)
- func ReadTable(name string) ([][]string, error)
- func StoreTableIdx(table string) int
- type AlphaNode
- func (an *AlphaNode[K]) AddFacts(facts []ut.Optional[FactI[K]])
- func (an *AlphaNode[K]) AddMods(mods []FactMod[K])
- func (an *AlphaNode[K]) Clear()
- func (an *AlphaNode[K]) GetTable() TableI[FactI[K]]
- func (an *AlphaNode[K]) Propagate()
- func (an *AlphaNode[K]) SetChild(child NodeI[K])
- func (an *AlphaNode[K]) String() string
- type BetaNode
- type Bip
- type Fact
- type FactI
- type FactMod
- type JoinType
- type NodeI
- type OrderBy
- type Pred
- type ReteNetwork
- type Rowi
- type Select
- type Selection
- type SortDir
- type Table
- func (t *Table[V]) AddRow1(r Rowi[V])
- func (t *Table[V]) AddRowF1(v ut.Optional[V])
- func (t *Table[V]) AddRowFN(vs []ut.Optional[V])
- func (t *Table[V]) AddRowsFN(vs []ut.Optional[V])
- func (t *Table[V]) Clear()
- func (t *Table[any]) CmpCsv(csvs [][]string) bool
- func (t *Table[V]) ColumnCount() int
- func (t *Table[V]) Columns() []string
- func (t *Table[V]) CrossJoin(o TableI[V]) TableI[V]
- func (t *Table[V]) DeleteF1(of ut.Optional[V])
- func (t *Table[V]) FullJoin(o TableI[V], preds []Bip[V]) TableI[V]
- func (t *Table[V]) GetValues() []ut.Optional[V]
- func (t *Table[V]) InnerJoin(o TableI[V], preds []Bip[V]) TableI[V]
- func (t *Table[V]) IsEmpty() bool
- func (t *Table[V]) IsValue() bool
- func (t *Table[V]) LeftJoin(o TableI[V], preds []Bip[V]) TableI[V]
- func (t *Table[V]) NaturalJoin(o TableI[V]) TableI[V]
- func (t *Table[V]) OrderBy(obs []OrderBy)
- func (t *Table[V]) RightJoin(o TableI[V], preds []Bip[V]) TableI[V]
- func (t *Table[V]) RowCount() int
- func (t *Table[V]) Rows() []Rowi[V]
- func (t *Table[V]) SameTables(o TableI[V]) bool
- func (t *Table[V]) Selection(selections []Select) TableI[any]
- func (t *Table[V]) String() string
- func (t *Table[V]) TableCount() int
- func (t *Table[V]) Tables() []int
- func (t *Table[V]) Union(o TableI[V]) TableI[V]
- func (t *Table[V]) UpdateRowF1(of ut.Optional[V])
- type TableI
- type TransactionType
Constants ¶
const TIX = "Tixx"
Variables ¶
This section is empty.
Functions ¶
func CalcKeys ¶
func CalcKeys[K comparable](u any) []K
func ClearTableIdx ¶
func ClearTableIdx()
func GetTableIdx ¶
func GetTableName ¶
func StoreTableIdx ¶
Types ¶
type AlphaNode ¶
type AlphaNode[K comparable] struct { // contains filtered or unexported fields }
func NewAlphaNode ¶
type BetaNode ¶
type BetaNode[K comparable] struct { // contains filtered or unexported fields }
func NewBetaNode ¶
type Bip ¶
type Bip[V comparable] struct { No int Test func(ut.Optional[V], ut.Optional[V]) bool Table1, Table2 int }
type Fact ¶
type Fact[K comparable] struct { Tablex string `json:"table-name"` Tixx int `json:"-"` }
type FactMod ¶
type FactMod[K comparable] struct { Trans TransactionType Table string Fact FactI[K] Tix int }
func NewFactMod ¶
func NewFactMod[K comparable](trans TransactionType, table string, fact FactI[K]) FactMod[K]
type NodeI ¶
type NodeI[K comparable] interface { // GetTable the facts of an alpha node and the joined facts of a beta node are stored in a Table of objects */ GetTable() TableI[FactI[K]] // SetChild the nodes are part of a binary tree network, so each alpha and beta node has one child and SetChild(NodeI[K]) // Propagate propagate the facts of the alpha nodes through the rete network */ Propagate() // Clear all data to make network ready for new calculations */ Clear() String() string // contains filtered or unexported methods }
type ReteNetwork ¶
type ReteNetwork[K comparable] struct { Modified bool NoIterations uint64 // contains filtered or unexported fields }
func NewReteNetwork ¶
func NewReteNetwork[K comparable](as []*AlphaNode[K], bs []*BetaNode[K]) *ReteNetwork[K]
func (*ReteNetwork[K]) AddMods ¶
func (r *ReteNetwork[K]) AddMods(ms []FactMod[K])
func (*ReteNetwork[K]) Clear ¶
func (r *ReteNetwork[K]) Clear()
func (*ReteNetwork[K]) HasTable ¶
func (r *ReteNetwork[K]) HasTable(tix int) bool
func (*ReteNetwork[K]) Propagate ¶
func (r *ReteNetwork[K]) Propagate()
type Rowi ¶
type Rowi[V comparable] interface { IsValue() bool Values() []ut.Optional[V] ValuesQ(int) []ut.Optional[V] Add(optional ut.Optional[V]) HasTable(int) bool Tables() ([]int, bool) String() string Equals(rowi Rowi[V]) bool SetTables(tables []int) Update(i int, of ut.Optional[V]) Delete(i int) // contains filtered or unexported methods }
func NewNullRow ¶
func NewNullRow[V comparable](n int) Rowi[V]
func NewRow ¶
func NewRow[V comparable]() Rowi[V]
type Table ¶
type Table[V comparable] struct { // contains filtered or unexported fields }
func NewTable ¶
func NewTable[V comparable]() *Table[V]
func NewTablePs ¶
func NewTablePs[V comparable](ts []int, cs []string) *Table[V]
func (*Table[V]) ColumnCount ¶
func (*Table[V]) NaturalJoin ¶
func (*Table[V]) SameTables ¶
func (*Table[V]) TableCount ¶
func (*Table[V]) Union ¶
Union merges the rows and columns of two tables (normally a SQL union requires the columns to be equal, but not in this function)
func (*Table[V]) UpdateRowF1 ¶
type TableI ¶
type TableI[V comparable] interface { IsValue() bool Rows() []Rowi[V] AddRow1(Rowi[V]) AddRowF1(v ut.Optional[V]) UpdateRowF1(of ut.Optional[V]) DeleteF1(of ut.Optional[V]) AddRowFN(v []ut.Optional[V]) AddRowsFN(v []ut.Optional[V]) RowCount() int TableCount() int ColumnCount() int Clear() Tables() []int Columns() []string SameTables(TableI[V]) bool InnerJoin(TableI[V], []Bip[V]) TableI[V] NaturalJoin(TableI[V]) TableI[V] CrossJoin(TableI[V]) TableI[V] LeftJoin(TableI[V], []Bip[V]) TableI[V] RightJoin(TableI[V], []Bip[V]) TableI[V] FullJoin(TableI[V], []Bip[V]) TableI[V] Union(TableI[V]) TableI[V] IsEmpty() bool GetValues() []ut.Optional[V] Selection([]Select) TableI[any] OrderBy([]OrderBy) }
TableI for the natural join operation on two tables the value type V needs to be comparable
type TransactionType ¶
type TransactionType int
const ( UPDATE TransactionType = iota INSERT DELETE ERROR NONE )
func (TransactionType) String ¶
func (i TransactionType) String() string