newbie question about type error

25 views
Skip to first unread message

Marko Schütz-Schmuck

unread,
Dec 2, 2014, 11:38:21 AM12/2/14
to ats-lan...@googlegroups.com
Dear All,

starting from the Fibonacci example online I tried to make a verified function for fibonorials. I'm stuck on an error message that I can't seem to make sense of. I would very much appreciate hints about what my mistake is and what techniques one should use to explore this kind of error.

The error I am getting is:

Fibonorial.dats: 1849(line=85, offs=3) -- 1900(line=85, offs=54): error(3): unsolved constraint: C3NSTRprop(main; S2Eeqeq(S2Evar(i(3847)); S2Evar(n(3846))))
typechecking has failed: there are some unsolved constraints: please inspect the above reported error message(s) for information.
exit(ATS): uncaught exception: _2home_2fac2_2hwxi_2research_2ATS_2IMPLEMENT_2Postiats_2git_2src_2pats_error_2esats__FatalErrorExn(1025)

Thanks and best regards,

Marko
Fibonorial.dats

gmhwxi

unread,
Dec 2, 2014, 1:14:59 PM12/2/14
to ats-lan...@googlegroups.com

I think that the cause of the type-error is that
you did not have a return type for the 'loop' function.

gmhwxi

unread,
Dec 2, 2014, 1:50:47 PM12/2/14
to ats-lan...@googlegroups.com

Marko Schütz-Schmuck

unread,
Dec 2, 2014, 3:56:33 PM12/2/14
to ats-lan...@googlegroups.com
I have patscc:
ATS/Postiats version 0.1.4 with Copyright (c) 2011-2014 Hongwei Xi
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

When I try to compile from the command line using `patscc -o Fibonorial Fibonorial.dats` I get an error:

Fibonorial1_dats.c:770:1: warning: data definition has no type or storage class [enabled by default]
Fibonorial1_dats.c:770:1: warning: type defaults to ?int? in declaration of ?ats2jspre_the_print_store_clear? [enabled by default]
Fibonorial1_dats.c:771:1: warning: data definition has no type or storage class [enabled by default]
Fibonorial1_dats.c:771:1: warning: type defaults to ?int? in declaration of ?my_dynload? [enabled by default]
Fibonorial1_dats.c:772:7: error: unknown type name ?ats2jspre_the_print_store_join?

I suspect it's from println!, but didn't find how to fix it.

Best regards,

Marko

Hongwei Xi

unread,
Dec 2, 2014, 4:17:12 PM12/2/14
to ats-lan...@googlegroups.com
That version is compiling to JavaScript so that the code can run in the browser.

Here is the version for generating C code:

--
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/77e0c5e7-c4e2-469c-b1cb-6e1db7186189%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages