ground_notcoexistence instantiates NotCoExistence with the same operand twice

Open Beginner friendly
#34 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
backend

Research direction

Open nl2ltl/engines/grounding.py and inspect ground_notcoexistence. Run the reported _get_formulas reproduction with the two connectors, then correct the duplicated operand so the result is (NotCoExistence reject_request escalate_to_human). Done means the grounding preserves both connector names instead of producing a self-pair.

Written by the indexing model from the issue text.

Description

Bug

nl2ltl/engines/grounding.py:

def ground_notcoexistence(connectors: Dict[str, float]) -> Set[Template]:
    if len(list(connectors)) >= 2:
        return {
            NotCoExistence(
                Atomic(decapitalize(list(connectors)[1])),
                Atomic(decapitalize(list(connectors)[1])),   # <-- [1] twice
            )
        }

Both operands are built from list(connectors)[1], so any two-symbol grounding produces a degenerate self-pair. Reproduction:

>>> from nl2ltl.engines.utils import _get_formulas
>>> _get_formulas("notcoexistence", {"reject_request": 1.0, "escalate_to_human": 1.0})
{(NotCoExistence escalate_to_human escalate_to_human)}

Expected: (NotCoExistence reject_request escalate_to_human).

The resulting LTLf, F(x) -> ~F(x), is equivalent to G(!x) — "x never happens" — which silently changes the meaning of the translated requirement (we caught it because a round-trip paraphrase of the formula no longer matched the input sentence).

Fix

Atomic(decapitalize(list(connectors)[0])),
Atomic(decapitalize(list(connectors)[1])),

Observed on nl2ltl from PyPI (Python 3.13). Found while building a Claude-backed custom Engine for translating agent-guardrail policies to DECLARE. Can send a PR if useful.

Dominant language
Python
Stars
101
Forks
14
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IBM/nl2ltl

All issues in IBM/nl2ltl

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.