MCPcopy
hub / github.com/google/mangle / Term

Interface Term

ast/ast.go:121–134  ·  view source on GitHub ↗

Term represents the building blocks of datalog programs, namely constants, variables, atoms, and also negated atoms, equality and inequality. Some minor differences to formal mathematical logic and prolog-style logic programming: - an Atom in datalog is always a predicate symbol applied to constant

Source from the content-addressed store, hash-verified

119// convention gives us a 1:1 mapping between term objects and their string representations, and
120// this is useful because Atom is not a hashable type (use String() to use Term as key in maps).
121type Term interface {
122 // Marker method.
123 isTerm()
124
125 // Returns a string representation.
126 String() string
127
128 // Syntactic (or structural) equality.
129 // If Equals returns true, terms have the same string representation.
130 Equals(Term) bool
131
132 // Returns a new term.
133 ApplySubst(s Subst) Term
134}
135
136// BaseTerm represents a subset of terms: constant, variables or ApplyFn.
137// Every BaseTerm will implement Term.

Callers 24

QueryInteractiveMethod · 0.65
mg.goFile · 0.65
mainFunction · 0.65
StringMethod · 0.65
WriteToMethod · 0.65
TestRoundTripFunction · 0.65
StringMethod · 0.65
MatchesFunction · 0.65
addAtomMethod · 0.65
removeAtomMethod · 0.65
ContainsMethod · 0.65

Implementers 9

Constantast/ast.go
Variableast/ast.go
Atomast/ast.go
NegAtomast/ast.go
ApplyFnast/ast.go
Eqast/ast.go
Ineqast/ast.go
TemporalAtomast/temporal.go
TemporalLiteralast/temporal.go

Calls

no outgoing calls

Tested by

no test coverage detected