conjure icon indicating copy to clipboard operation
conjure copied to clipboard

Cannot index an empty matrix

Open SaadAttieh opened this issue 5 years ago • 4 comments

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

SaadAttieh avatar Jul 22 '19 12:07 SaadAttieh

Savile Row can't parse those question marks.

pwn1 avatar Jul 22 '19 12:07 pwn1

Yeah, I did think that wasn't eprime syntax. :P On 22 Jul 2019, at 1:42 pm, Peter Nightingale [email protected] wrote:

Savile Row can't parse those question marks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

SaadAttieh avatar Jul 22 '19 15:07 SaadAttieh

@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]

ozgurakgun avatar Sep 10 '19 13:09 ozgurakgun

OK, that should be documented I suppose.

pwn1 avatar Sep 10 '19 14:09 pwn1