Newbie question about type error

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 (1.98 KB)

I put your code at pastebin.com:

http://www.ats-lang.org/SERVER/MYCODE/Patsoptaas_serve.php?mycode_url=http://pastebin.com/raw.php?i=BneDprXE

It works!On Tuesday, December 2, 2014 1:14:59 PM UTC-5, gmhwxi wrote:

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

On Tuesday, December 2, 2014 11:38:21 AM UTC-5, Marko Schütz-Schmuck wrote:

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

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,

MarkoOn Tuesday, December 2, 2014 2:50:47 PM UTC-4, gmhwxi wrote:

I put your code at pastebin.com:

http://www.ats-lang.org/SERVER/MYCODE/Patsoptaas_serve.php?mycode_url=http://pastebin.com/raw.php?i=BneDprXE

It works!

On Tuesday, December 2, 2014 1:14:59 PM UTC-5, gmhwxi wrote:

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

On Tuesday, December 2, 2014 11:38:21 AM UTC-5, Marko Schütz-Schmuck wrote:

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

I think that the cause of the type-error is that
you did not have a return type for the ‘loop’ function.On Tuesday, December 2, 2014 11:38:21 AM UTC-5, Marko Schütz-Schmuck wrote:

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

That version is compiling to JavaScript so that the code can run in the
browser.

Here is the version for generating C code:

http://pastebin.com/pNyQCLVhOn Tue, Dec 2, 2014 at 3:56 PM, Marko Schütz-Schmuck < markos...@googlemail.com> wrote:

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

On Tuesday, December 2, 2014 2:50:47 PM UTC-4, gmhwxi wrote:

I put your code at pastebin.com:

http://www.ats-lang.org/SERVER/MYCODE/Patsoptaas_
serve.php?mycode_url=http://pastebin.com/raw.php?i=BneDprXE

It works!

On Tuesday, December 2, 2014 1:14:59 PM UTC-5, gmhwxi wrote:

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

On Tuesday, December 2, 2014 11:38:21 AM UTC-5, Marko Schütz-Schmuck wrote:

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


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
https://groups.google.com/d/msgid/ats-lang-users/77e0c5e7-c4e2-469c-b1cb-6e1db7186189%40googlegroups.com?utm_medium=email&utm_source=footer
.