(c func(sym ast.PredicateSym) error, clause ast.Clause)
| 836 | } |
| 837 | |
| 838 | func (a *Analyzer) check(c func(sym ast.PredicateSym) error, clause ast.Clause) error { |
| 839 | for _, p := range clause.Premises { |
| 840 | switch p := p.(type) { |
| 841 | case ast.Atom: |
| 842 | if err := c(p.Predicate); err != nil { |
| 843 | return err |
| 844 | } |
| 845 | case ast.NegAtom: |
| 846 | if err := c(p.Atom.Predicate); err != nil { |
| 847 | return err |
| 848 | } |
| 849 | default: |
| 850 | continue |
| 851 | } |
| 852 | } |
| 853 | return nil |
| 854 | } |
| 855 | |
| 856 | func (a *Analyzer) checkPredicates(clause ast.Clause) error { |
| 857 | return a.check(func(sym ast.PredicateSym) error { |
no outgoing calls