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

Completeness bug: Solver does not terminate for forall-exists formula with recursive bound variable types #50

Open
rindPHI opened this issue Jan 9, 2023 · 0 comments
Labels
bug Something isn't working completeness medium Bugs/issues of medium importance

Comments

@rindPHI
Copy link
Owner

rindPHI commented Jan 9, 2023

Describe the bug

The solver does not output solutions for a particular class of constraints such as in the following example:

grammar = {
    "<start>": ["<E>$"],
    "<E>": ["<T><EE>"],
    "<EE>": ["+<T><EE>", ""],
    "<T>": ["<F><TT>"],
    "<TT>": ["*<F><TT>", ""],
    "<F>": ["(<E>)", "a", "b", "c", "d", "e", "f", "g"],
}

inside_test = """
forall <F> f2 in start:
exists <F> f1="({<E> e})" in start:
(not (= f2 "a") or not inside(f2, e))"""

solver = ISLaSolver(
    grammar, inside_test, structural_predicates={IN_TREE_PREDICATE}
)

# Here are some examples of passing and failing inputs
# print(solver.parse("(e)$").to_parse_tree())  # Passes
# print(solver.parse("(e)+(a)$").to_parse_tree())  # Passes
# print(solver.parse("(a)+(a)$").to_parse_tree())  # Passes
# print(solver.parse("(a)$").to_parse_tree())  # Fails

for _ in range(10):
    print(solver.solve())

See (inactive) test case Xtest_negated_constraint in test_solver.py (should soon be on the master branch).

The problem probably is rooted in tree insertion.

Expected behavior

We want some outputs such as the ones in the comments above.

System/Installation Specs:

  • ISLa Version: 1.10.0
@rindPHI rindPHI added completeness bug Something isn't working medium Bugs/issues of medium importance labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completeness medium Bugs/issues of medium importance
Projects
None yet
Development

No branches or pull requests

1 participant