Checks that a boundDecl is well-formed. It validates that there is a bound for each argument, and that each bound is a well-formed bound.
(p ast.Atom, boundDecl ast.BoundDecl)
| 104 | // It validates that there is a bound for each argument, and |
| 105 | // that each bound is a well-formed bound. |
| 106 | func (c *declChecker) checkBound(p ast.Atom, boundDecl ast.BoundDecl) { |
| 107 | if len(boundDecl.Bounds) != len(p.Args) { |
| 108 | c.errs = append(c.errs, fmt.Errorf("in decl %v: expected %d bounds, got %d: %v ", p, len(p.Args), len(boundDecl.Bounds), boundDecl.Bounds)) |
| 109 | } |
| 110 | for i, bound := range boundDecl.Bounds { |
| 111 | if err := symbols.WellformedBound(bound); err != nil { |
| 112 | c.errs = append(c.errs, fmt.Errorf("in decl %v: the bound for argument %d must be parseable as predicate name: %v (%w)", p, i, bound, err)) |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | // Checks that a base term is a string constant. |
| 118 | func (c *declChecker) checkStringConstant(baseTerm ast.BaseTerm) { |
no test coverage detected