Can proof functions be overloaded? Or alternatively, do I really understand what overloading means in ATS context? To me, an overloaded function is a function of the same name as another, but with a different type (the type may include the return type or not, depending on the language).
I'm still playing with the Beautiful example, and wanted to try this:
dataprop
BEAUTIFUL
(int)
= B_0 (0)
| B_3 (3)
| B_5 (5)
| {m, n: nat}
B_SUM (n + m)
of (BEAUTIFUL m, BEAUTIFUL n)
prfn
is_beautiful
{m: nat | m == 3}
(x: int (m))
: BEAUTIFUL m
= B_3 ()
prfn
is_beautiful
{m: nat | m == 5}
(x: int (m))
: BEAUTIFUL m
= B_5 ()
prfn
eight_is_beautiful
{m, n: nat | m == 3; n == 5}
(x: int (m), y: int (n))
: BEAUTIFUL (m + n)
= B_SUM
(is_beautiful x,
is_beautiful y)
The point here, is the two proof functions named `is_beautiful`. To my understanding of overloading, both forms an overloading of the name `is_beautiful`, but `patscc` complains the third function is left with unsolved constraints. When both function have different names, the third proof function type‑checks.
I'm not able to guess if my issue is that it's not an overloading as I believe or if it's that there are limitation(s) with proof function overloading.