Constraint cannot be translated into a form accepted by the constraint solver?

58 views
Skip to first unread message

Shea Levy

unread,
Apr 15, 2015, 10:56:52 PM4/15/15
to ats-lan...@googlegroups.com
Hi all,

I have some code yielding the following errors:

warning(3): the constraint [S2Eeqeq(S2Eexi(p$6908(12234); ; S2Eapp(S2Ecst(filedes); S2Eintinf(1), S2Evar(p$6908(12234)))); S2Eexi(p$6912(12238); ; S2Eapp(S2Ecst(filedes); S2Eintinf(1), S2Evar(p$6912(12238)))))] cannot be translated into a form accepted by the constraint solver.
error(3): unsolved constraint: C3NSTRprop(main; S2Eeqeq(S2Eexi(p$6908(12234); ; S2Eapp(S2Ecst(filedes); S2Eintinf(1), S2Evar(p$6908(12234)))); S2Eexi(p$6912(12238); ; S2Eapp(S2Ecst(filedes); S2Eintinf(1), S2Evar(p$6912(12238))))))
error(3): unsolved constraint for var preservation
warning(3): the constraint [S2Eeqeq(S2Eexi(p$6909(12235); ; S2Eapp(S2Ecst(filedes); S2Eintinf(2), S2Evar(p$6909(12235)))); S2Eexi(p$6913(12239); ; S2Eapp(S2Ecst(filedes); S2Eintinf(2), S2Evar(p$6913(12239)))))] cannot be translated into a form accepted by the constraint solver.
error(3): unsolved constraint for var preservation
typechecking has failed: there are some unsolved constraints: please inspect the above reported error message(s) for information.
exit(ATS): uncaught exception: _2home_2hwxi_2research_2Postiats_2git_2src_2pats_error_2esats__FatalErrorExn(1025)

I’ve tried making the code less complex in various ways to make a simple test case, and each attempt makes the error go away (though in one case the compiler segfaulted, and in another it hit "exit(ATS): /home/hwxi/research/Postiats/git/src/pats_typerase_dynexp.dats: 18565 (line=816, offs=9) -- 18617(line=816, offs=61): match failure.”). Is there any way I can debug this? Should I just attach the whole program?

Thanks,
Shea

gmhwxi

unread,
Apr 15, 2015, 11:29:28 PM4/15/15
to ats-lan...@googlegroups.com

I think I know this one. I uploaded into Github a fix for it.

Shea Levy

unread,
Apr 16, 2015, 6:25:29 AM4/16/15
to ats-lan...@googlegroups.com
Thanks! Now I don’t get that error, I just get:

exit(ATS): /home/shlevy/src/ATS-Postiats/src/pats_typerase_dynexp.dats: 18567(line=820, offs=9) -- 18619(line=820, offs=61): match failure.

Poking around a bit, it looks like s2exp2hnf is returning a None_vt when only a Some_vt is expected there, inside of a D3Earrinit. Does that mean somehow the type of the size of the array doesn’t have an HNF? The only array initialization in my code is:

var buf = @[byte][buf_sz]()

where I have:

stadef buf_sz = 10

earlier in the file.

OK, so if I replace every instance of buf_sz with 10 it type checks. Is this somehow a bug in stadef? Or am I using it wrong?

Thanks,
Shea
> --
> You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
> To post to this group, send email to ats-lan...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/c22cae44-a9db-499f-921b-a18ea8372079%40googlegroups.com.

Shea Levy

unread,
Apr 16, 2015, 6:32:06 AM4/16/15
to ats-lan...@googlegroups.com
Ah, I misdiagnosed, the buf_sz in the array initialization came from the *dynamic* buf_sz val I declared on the previous line, not the stadef. I opened up a github issue [1] for this.

~Shea

[1]: https://github.com/githwxi/ATS-Postiats/issues/133
> To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/241B3CE2-7888-47E1-8B26-6596828D8AA6%40shealevy.com.

Reply all
Reply to author
Forward
0 new messages