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

Method ContainsAt

factstore/temporal.go:262–280  ·  view source on GitHub ↗

ContainsAt returns true if the atom is valid at the given time.

(atom ast.Atom, t time.Time)

Source from the content-addressed store, hash-verified

260
261// ContainsAt returns true if the atom is valid at the given time.
262func (s *TemporalStore) ContainsAt(atom ast.Atom, t time.Time) bool {
263 predMap, ok := s.facts[atom.Predicate]
264 if !ok {
265 return false
266 }
267
268 tree, ok := predMap[atom.Hash()]
269 if !ok {
270 return false
271 }
272
273 found := false
274 timestamp := t.UnixNano()
275 tree.QueryPoint(timestamp, func(interval ast.Interval) error {
276 found = true
277 return nil
278 })
279 return found
280}
281
282// ListPredicates returns all predicates in the store.
283func (s *TemporalStore) ListPredicates() []ast.PredicateSym {

Callers 2

Calls 2

QueryPointMethod · 0.80
HashMethod · 0.65

Tested by 2