Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Format strings error in creating contracts #347

Open
ayush9pandey opened this issue Jun 13, 2024 · 0 comments
Open

[BUG] Format strings error in creating contracts #347

ayush9pandey opened this issue Jun 13, 2024 · 0 comments
Assignees

Comments

@ayush9pandey
Copy link
Collaborator

Describe the bug
Bug when using format strings in contract creation from strings. Two negatives should become a positive (i.e. -1 * -1 = 1).

To Reproduce
Steps to reproduce the behavior:

code
a = 2
b = 100
c = 1
d = -10

my_contract = PolyhedralIoContract.from_strings(
    input_vars=["x"],
    output_vars=["y"],
    assumptions=[],
    guarantees=[f"y >= {a}x + {b} - {c*d}"]
)

Expected behavior
Contract should be created without problems.

Screenshots

PolyhedralSyntaxException: pacti.terms.polyhedra.PolyhedralTerm syntax error.
y >= -2 x + 100  - - 10
                            ^
Expected end of text, found '-'  (at char 56), (line:1, col:57)

System (please complete the following information):

  • OS: Windows
  • Software version: Pacti pip 0.1.0
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

No branches or pull requests

2 participants