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

Function toOrderMap

analysis/stratification_test.go:36–45  ·  view source on GitHub ↗
(predToStratum map[ast.PredicateSym]int)

Source from the content-addressed store, hash-verified

34}
35
36func toOrderMap(predToStratum map[ast.PredicateSym]int) map[int][]ast.PredicateSym {
37 unsorted := make(map[int][]ast.PredicateSym)
38 for sym, order := range predToStratum {
39 unsorted[order] = append(unsorted[order], sym)
40 }
41 for _, slice := range unsorted {
42 sort.Slice(slice, func(i, j int) bool { return slice[i].Symbol < slice[j].Symbol })
43 }
44 return unsorted
45}
46
47func analyze(clauses []ast.Clause) (*ProgramInfo, error) {
48 return AnalyzeOneUnit(parse.SourceUnit{Clauses: clauses}, nil)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected