On Tue, Dec 09, 2025 at 08:57:21AM +0100, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote:
> Dear Waldek,
>
> it seems that I was too hopeful.
>
> Unfortunately, the attached program give the following output.
> It seems that the interpreter is unable to check a domain-evaluating
> function parameter for its correct type. :-(
>
> Can this be easily fixed?
Probably not. Interpreter type checking in many places ignores
categories, using 'Type' instead. I would have to investigate
deeper, but at first glance the problem you see is that interpteter
uses 'Type' and function declaration has more specific category.
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
fricas-devel...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/6ac741f1-49c4-4709-8962-f5a76203c3f3%40hemmecke.org.
> )abbrev category CAT Cat
> Cat: Category == with
> foo: Integer -> Integer
>
> )abbrev domain DOM1 D1
> D1: Cat == add
> foo(n: Integer) == 1
>
> )abbrev domain DOM2 D2
> D2: Cat == add
> foo(n: Integer) == 2
>
> )abbrev domain DOM Dom
> Dom(): Join(IntegerNumberSystem, CoercibleTo Integer) with
> bar?: (Cat, Integer) -> % -> Boolean
> baz1: Integer -> % -> Integer
> baz2: Integer -> % -> Integer
> == Integer add
> Rep ==> Integer
> coerce(x: %): Integer == x pretend Integer
> bar?(D: Cat, n: Integer): % -> Boolean == (x: %): Boolean +->
> foo(n+(x::Integer))$D = 1
> baz1(n: Integer): % -> Integer == (x: %): Integer +-> foo(n+(x::Integer))$D1
> baz2(n: Integer): % -> Integer == (x: %): Integer +-> foo(n+(x::Integer))$D2
--
Waldek Hebisch