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

Cannot index an empty matrix #443

Open
SaadAttieh opened this issue Jul 22, 2019 · 4 comments
Open

Cannot index an empty matrix #443

SaadAttieh opened this issue Jul 22, 2019 · 4 comments

Comments

@SaadAttieh
Copy link
Collaborator

letting s be []
find a : int(1..5)
such that
a = s[1]

Conjure output:

Generating models for test.essence
Generated models: model000001.eprime
Saved under: conjure-output
Savile Row: model000001.eprime
Error:
    Savile Row stdout: 
    Savile Row stderr: such that a = ([] : `matrix indexed by [?] of ?`)[1]

---------------------------------------^
ERROR: Successfully parsed 'matrix indexed by'.
ERROR: Failed when parsing rest of structure following line:5 column:39

    Savile Row exit-code: 1
@pwn1
Copy link
Collaborator

pwn1 commented Jul 22, 2019

Savile Row can't parse those question marks.

@SaadAttieh
Copy link
Collaborator Author

SaadAttieh commented Jul 22, 2019 via email

@ozgurakgun
Copy link
Collaborator

ozgurakgun commented Sep 10, 2019

@pwn1 - SR seems to assume that [] is the same as ([] : matrix indexed by [int()] of int)

So this is UNSAT (with or without the type annotation)

letting s be ([] : `matrix indexed by [int()] of int`)
find a : int(1..5)
such that a = s[1]

And this has 1 solution with the type annotation, and it is UNSAT without

letting s be ([] : `matrix indexed by [int()] of bool`)
find a : bool
such that
a = s[1]

@pwn1
Copy link
Collaborator

pwn1 commented Sep 10, 2019

OK, that should be documented I suppose.

ozgurakgun added a commit that referenced this issue Sep 29, 2019
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

3 participants