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

Function NewQuery

ast/ast.go:1047–1053  ·  view source on GitHub ↗

NewQuery is a convenience constructor for constructing a goal atom.

(predicate PredicateSym)

Source from the content-addressed store, hash-verified

1045
1046// NewQuery is a convenience constructor for constructing a goal atom.
1047func NewQuery(predicate PredicateSym) Atom {
1048 vars := make([]BaseTerm, predicate.Arity)
1049 for i := 0; i < predicate.Arity; i++ {
1050 vars[i] = Variable{fmt.Sprintf("X%d", i)}
1051 }
1052 return Atom{predicate, vars}
1053}
1054
1055// NegAtom represents a negated atom.
1056type NegAtom struct {

Callers 15

ParseQueryMethod · 0.92
GetAllFactsFunction · 0.92
MergeMethod · 0.92
MergeMethod · 0.92
MergeMethod · 0.92
MergeMethod · 0.92
WriteToMethod · 0.92
TestRoundTripFunction · 0.92

Calls

no outgoing calls

Tested by 10

TestRoundTripFunction · 0.74
TestTransformFunction · 0.74
TestNewSyntheticDeclFunction · 0.68
TestDeclPackageFunction · 0.68