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

Interface ExternalPredicateCallback

engine/seminaivebottomup.go:85–92  ·  view source on GitHub ↗

ExternalPredicateCallback is used to query external data sources. An atom `mydb(input1, ..., inputN, OutputVar1, ..., OutputVarN)` is evaluated as follows: - the engine checks whether the fact store contains any facts of the shape `mydb(input1, ..., inputN, _, ..., _)`. If so, we use those for eval

Source from the content-addressed store, hash-verified

83// but is also free to ignore them. In any case, when constant filter arguments
84// are present, only matching facts will be added to the store.
85type ExternalPredicateCallback interface {
86 // If true, the engine will pass any subgoals of the clause that mention output variables
87 // to ExecuteQuery. Otherwise, the pushdown argument will be empty.
88 ShouldPushdown() bool
89 ShouldQuery(inputs []ast.Constant, filters []ast.BaseTerm, pushdown []ast.Term) bool
90 ExecuteQuery(inputs []ast.Constant, filters []ast.BaseTerm, pushdown []ast.Term,
91 cb func([]ast.BaseTerm)) error
92}
93
94// EvalOptions are used to configure the evaluation.
95type EvalOptions struct {

Callers 3

oneStepEvalPremiseMethod · 0.65
EvalExternalQueryMethod · 0.65
EvalExternalQueryMethod · 0.65

Implementers 1

ExtImplengine/seminaivebottomup_test.go

Calls

no outgoing calls

Tested by

no test coverage detected