The polynomial should be lam x => x * x - x - 110. Fixed.On Sun, Feb 1, 2015 at 7:17 AM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:
It says “For instance, calling rtfind on the polynomial function lam x =>
x * x - x + 110 returns 11”. But x² - x + 110 = 0 has no solution in ℝ.
Testing the example returns the erroneous result 463410 on my 32 bits
machine.
Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
I don’t remember of any already existing one, so I’m opening this thread
where to report any errors in the docs, instead of opening a new thread for
each possible eventual errors (saying that, I don’t want to mean there are
many).
In http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/x2528.html
, about the second definition of the isqrt function, this sentence looks
strange to me: “The following code we obtain after proper modification does
pass typechecking”. Actually, it does not: both patscc --typecheck and patscc -tcats tells about one unsolved constraint error and two unsolved
termination constraints errors.
Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
I don’t remember of any already existing one, so I’m opening this thread
where to report any errors in the docs, instead of opening a new thread for
each possible eventual errors (saying that, I don’t want to mean there are
many).
Fixed. Thanks!On Wed, May 20, 2015 at 1:08 AM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:
Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
I don’t remember of any already existing one, so I’m opening this thread
where to report any errors in the docs, instead of opening a new thread for
each possible eventual errors (saying that, I don’t want to mean there are
many).
At least, adding a termination metric, without touching the function’s
logic, makes ATS catch an error:
fun fact
{n: int} (n: int n): int = let
fun loop {n: int} .. (n: int n, res: int): int =
if n > 0 then loop (n, n * res) else res
// end of [loop]
in
loop (n, 1)
end // end of [fact]
This one is OK:
fun fact
{n: nat} (n: int n): int = let
fun loop {n: nat} .. (n: int n, res: int): int =
if n > 0 then loop (n - 1, n * res) else res
// end of [loop]
in
loop (n, 1)
end // end of [fact]
This seems to be the same with the two preceding functions.
“Within the ATS programming langauge system” (should be “language”)
Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
I don’t remember of any already existing one, so I’m opening this thread
where to report any errors in the docs, instead of opening a new thread for
each possible eventual errors (saying that, I don’t want to mean there are
many).