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
| 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). |
| 121 | type 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. |
no outgoing calls
no test coverage detected