Skip to content

Replace carl-parser with Lark parser#416

Open
volkm wants to merge 11 commits into
stormchecker:masterfrom
volkm:lark-parser
Open

Replace carl-parser with Lark parser#416
volkm wants to merge 11 commits into
stormchecker:masterfrom
volkm:lark-parser

Conversation

@volkm

@volkm volkm commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Replaced the C++ bindings of carl-parser with the Python-based Lark parser. Follows the suggestion to make it more maintainable.

  • lark is an optional dependency and can be installed with pip install stormpy[parser].
  • the lark grammar is tightly aligned with the carl-parser grammar. A notable difference is that I removed support for . in variable names. Otherwise - 2.5 could be parsed as the subtraction of 2 and a variable named .5. The variable names currently still support a long list of symbols which I find unnecessary complicated, but I opted to follow the original carl-parser grammar.
  • arithmetic operations first try to apply the operation on the given types, afterwards try the reverse order, and lastly cast everything to Polynomial and try again. This is relatively simple to implement, but could be too expensive in certain cases.

Most implementation work was done by opencode bot@opencode.ai (model: opencode/big-pickle).

Comment thread pyproject.toml
"numpy",
"scipy",
]
dev = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too much. I just changed the order to have dev come before doc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont understand what this did and why we no longer need it :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not really different from the main Dockerfile. There might have been changes at an earlier point, was introduced in #229

@sjunges

sjunges commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Great progress! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants