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

Refinement of matrix expression is not valid Essence' #651

Open
ChrisJefferson opened this issue Mar 14, 2024 · 0 comments
Open

Refinement of matrix expression is not valid Essence' #651

ChrisJefferson opened this issue Mar 14, 2024 · 0 comments

Comments

@ChrisJefferson
Copy link
Collaborator

Consider the following model:

language Essence 1.0


find x : matrix indexed by [int(1..10)] of int(1..10)

find m : matrix indexed by [int(1..55)] of int(1..10)

such that
x = [ sum([m[k] | k : int(i..j)]) | i,j : int(1..10), i <= j]

The constraint is refined to the basically identical:

x=[sum([m[k]|k : int(i..j), () ;int(1..)])|i : int(1..10), j : int(1..10), ((i<=j)) ;int(1..)]

But, Essence' doesn't do matrix equality.

I can fix this doing the horrible-at-first-glance:


forAll iter: int(1..sum([1 | i : int(1..10), j : int(1..10), i <= j])).
(x[iter] = [sum([m[k] | k : int(i..j)]) | i : int(1..10), j : int(1..10), i <= j][iter])
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

1 participant