Closed ChrisJefferson closed 1 year ago
Similar issue, I'd be getting into variants, but there I get This is not an int. Boo.
.
I wonder if I should be using astjson? Or maybe the JSON format needs slightly more info on the type of things? (I'd be happy to mark things with their type for distinguishing purposes, but the whole astjson is a bit serious)
I am keen to improve the json input. astjson would be too brittle (since it depends on the internal structure very much)
let me know if you have any other cases and I will fix them - as soon as I have some free time...
Can you give a variant example as well please?
%load_ext conjure
<IPython.core.display.Javascript object>
Conjure extension is loaded.
For usage help run: %conjure_help
%%conjure
find w : variant { a: int(1..10), b: int(1..10) }
such that
w[a] = 2
{'w': {'a': 2}}
%conjure_clear
Conjure model cleared
q = {'a': 2}
%%conjure
given q : variant { a: int(1..10), b: int(1..10) }
find w : variant { a: int(1..10), b: int(1..10) }
such that
q = w
Exception: Error: This is not an int. Boo.
Just to say, all issues I had are now fixed, and all types I've tried (including 2d matrices and functions) all translate both to and from JSON correctly.
Trying to have a
given w: bool
results in a notebook leads tothe following. I imagine this is easy to fix, just not implemented?