conjure-cp / conjure

Conjure: The Automated Constraint Modelling Tool
Other
96 stars 20 forks source link

Crashes modelling function as a relation #664

Open N-J-Martin opened 2 weeks ago

N-J-Martin commented 2 weeks ago

I tried to run conjure modelling --portfolio=10 essenceDir/modellingTest.essence with modellingTest.essence containing

find y:function int(1..10) --> int(10..20)
 find z:set of int(1..5) 

The program crashed, producing the output in errormessage.txt

This might be related to when conjure ide --dump-representations is run, y has 3 options:

{"name": "y",
  "representations":
      [{"answer": 1, "description": "function {Function1DPartial} int(1..10) --> int(10..20)"},
       {"answer": 2, "description": "function {FunctionNDPartialDummy} int(1..10) --> int(10..20)"},
       {"answer": 3, "description": "function {FunctionAsRelation[RelationAsMatrix]} int(1..10) --> int(10..20)"}]}

but whenconjure modelling is run, only 2 options are permitted:

    Answer 1: choose-repr: Choosing representation for y:
                               function {Function1DPartial} int(1..10) -->
                                   int(10..20)
    Answer 2: choose-repr: Choosing representation for y:
                               function {FunctionNDPartialDummy} int(1..10) -->
                                   int(10..20)
ozgurakgun commented 2 weeks ago

I suspect this is to do with --representation-levels=on/off. There are probably two different (and conflicting) defaults.

Thanks for the report though, it's a big nevertheless, of course.

N-J-Martin commented 2 weeks ago

You're right! I tried conjure modelling with representation-levels off, and was presented with the 3rd option for y. It crashed as above when I tried to use the option. Thanks for the help!