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

Function EvalProgramWithStats

engine/seminaivebottomup.go:158–168  ·  view source on GitHub ↗

EvalProgramWithStats evaluates a given program on the given facts, modifying the fact store in the process. Deprecated: use EvalStratifiedProgramWithStats instead.

(programInfo *analysis.ProgramInfo, store factstore.FactStore, options ...EvalOption)

Source from the content-addressed store, hash-verified

156// EvalProgramWithStats evaluates a given program on the given facts, modifying the fact store in the process.
157// Deprecated: use EvalStratifiedProgramWithStats instead.
158func EvalProgramWithStats(programInfo *analysis.ProgramInfo, store factstore.FactStore, options ...EvalOption) (Stats, error) {
159 strata, predToStratum, err := analysis.Stratify(analysis.Program{
160 EdbPredicates: programInfo.EdbPredicates,
161 IdbPredicates: programInfo.IdbPredicates,
162 Rules: programInfo.Rules,
163 })
164 if err != nil {
165 return Stats{}, fmt.Errorf("stratification: %w", err)
166 }
167 return EvalStratifiedProgramWithStats(programInfo, strata, predToStratum, store, options...)
168}
169
170// EvalStratifiedProgramWithStats evaluates a given stratified program on the given facts,
171// modifying the fact store in the process.

Callers 2

evalProgramMethod · 0.92
EvalProgramFunction · 0.85

Calls 2

StratifyFunction · 0.92

Tested by

no test coverage detected