code: func (c *Compiler) buildRuleIndices() {
  
  	c.RuleTree.DepthFirst(func(node *TreeNode) bool {
  		if len(node.Values) == 0 {
  			return false
  		}
  		index := newBaseDocEqIndex(func(ref Ref) bool {
  			return len(c.GetRules(ref.GroundPrefix())) > 0
  		})
  		if rules := extractRules(node.Values); index.Build(rules) {
  			c.ruleIndices.Put(rules[0].Path(), index)
  		}
  		return false
  	})
  
  }
docs: // buildRuleIndices constructs indices for rules.