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

Crash constructing prefixes of sequences. #571

Open
pwn1 opened this issue Jun 6, 2023 · 4 comments
Open

Crash constructing prefixes of sequences. #571

pwn1 opened this issue Jun 6, 2023 · 4 comments
Assignees

Comments

@pwn1
Copy link
Collaborator

pwn1 commented Jun 6, 2023

Hi Oz,

Here's a tiny part of a model that constructs a set Valid (intended to be all prefixes of sequences in Subs).

Is the issue that you might have int(0..-1) for the length-0 prefixes?

language ESSENCE 1.3.0

$ Number of subscribers
given nSubs : int(1..)

letting Digit be domain int(0..9)

given Subs : matrix [ int(1..nSubs) ] of sequence of Digit

$  Shame there is no set comprehension. Needs toSet here. 
letting Valid be toSet([ [ s(j) | j : int(0..i) ]  | s <- Subs, i : int(-1..|s|) ])

And this is what happens if you put it into Conjure:

conjure: This should never happen, sorry!

However, it did happen, so it must be a bug. Please report it to us!

Conjure is actively maintained, we will get back to you as soon as possible.
You can help us by providing a minimal failing example.

Also include the repository version for this build: 008667d6a (2023-06-01 09:38:43 +0100)

Issue tracker: http://github.com/conjure-cp/conjure/issues


BUGFAIL at rule_ChooseReprForLocals
domainSizeOf infinite range: 1..

CallStack (from HasCallStack):
  error, called at src/Conjure/Bug.hs:17:15 in conjure-cp-2.5.0-J7nVvZRONHz6Zg6XNQCcrd:Conjure.Bug
  bug, called at src/Conjure/Bug.hs:39:21 in conjure-cp-2.5.0-J7nVvZRONHz6Zg6XNQCcrd:Conjure.Bug
@pwn1
Copy link
Collaborator Author

pwn1 commented Jun 30, 2023

Hi Oz, do you think this would be an easy fix or lots of work? @ozgurakgun

@ozgurakgun
Copy link
Collaborator

Hi Pete. Hard to know. As far as I can see for the toSet at the top level Conjure tries to create a top level decision variable which is unlikely to be what you want. How do you plan to use Valid in the rest of the model? If you send me a fuller model I can take another look.

@pwn1
Copy link
Collaborator Author

pwn1 commented Jul 1, 2023

Thanks Oz

The constraint that uses Valid just says something like "s in Valid -> ...." where s is a sequence decision variable. imagine s is the sequence of digits that someone dialled so far, and if that sequence is not in Valid then they are not going to be able to complete dialling a valid number.

@pwn1
Copy link
Collaborator Author

pwn1 commented Jul 1, 2023

Maybe I can avoid making Valid and just check the prefix condition some other way.

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