Detect lexical ambiguity due to regex overlap

Open
#4,271 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

Start by reading the lexer behavior and the overlap scenario described in #4255. Compare detecting equal-prec(_) regex overlaps during every kompilation with exposing the dedicated -Wregex-overlap flag. Done means overlapping terminals with the same precedence are detected instead of depending on set iteration order.

Written by the indexing model from the issue text.

Description

If two regex terminals overlap and have the same prec(_) value, their precedence in the lexer is flaky and dependent on set iteration order (see #4255).

We should detect such ambiguities, either during every kompilation if it can be done cheaply, or with a dedicated -Wregex-overlap flag.

Dominant language
Python
Stars
591
Forks
163
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 runtimeverification/k

All issues in runtimeverification/k

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.