docs← Back to article

Markdown for LLMs

same-side-priority-review

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# same-side-priority-review

Приоритет между двумя правилами одной головы и одной полярности, не участвующими в других приоритетных рёбрах — ребро на ревью: между согласными кандидатами побеждать нечего.

## Query

```lawq
from p in nodes
where p.kind == "priority_rule"
  and exists(h in edges
             where (h.from == p.id and h.role == "higher.id"
                    and exists(l in edges
                               where (l.from == p.id and l.role == "lower.id"
                                      and exists(a in rules
                                                 where (a.id == h.to
                                                        and exists(b in rules
                                                                   where (b.id == l.to
                                                                          and b.head_predicate == a.head_predicate
                                                                          and b.head_polarity == a.head_polarity))))
                                      and not exists(o in edges
                                                     where (o.to == h.to and o.from != p.id
                                                            and exists(q in nodes
                                                                       where (q.id == o.from and q.kind == "priority_rule"))))
                                      and not exists(u in edges
                                                     where (u.to == l.to and u.from != p.id
                                                            and exists(w in nodes
                                                                       where (w.id == u.from and w.kind == "priority_rule"))))))))
select p.id as node, anchor(p.id) as anchors
```