using 'if C is Integer then ...'

9 views
Skip to first unread message

Ralf Hemmecke

unread,
May 16, 2024, 3:12:04 AM5/16/24
to fricas-devel
When I compile the attached program, I get the error below. Does that
mean that I cannot use "if C is Integer then ..." in the category part
of a domain?

Ralf

%%% (295) -> )co ../foo.spad
Compiling FriCAS source code from file
/home/hemmecke/backup/git/qeta/tmp/../foo.spad using old system
compiler.
FOO abbreviates package Foo
------------------------------------------------------------------------
initializing NRLIB FOO for Foo
compiling into NRLIB FOO

>> System error:
formatPred
foo.spad

Waldek Hebisch

unread,
May 16, 2024, 8:00:30 AM5/16/24
to fricas...@googlegroups.com
On Thu, May 16, 2024 at 09:12:01AM +0200, Ralf Hemmecke wrote:
> When I compile the attached program, I get the error below. Does that mean
> that I cannot use "if C is Integer then ..." in the category part of a
> domain?

Yes, this is limitation of current compiler. It would be relatively
easy to allow more general conditions, but important part of
current handling involves inference and inference is only
implemented for 'has' and boolean combinations of 'has' conditions.

> %%% (295) -> )co ../foo.spad
> Compiling FriCAS source code from file
> /home/hemmecke/backup/git/qeta/tmp/../foo.spad using old system
> compiler.
> FOO abbreviates package Foo
> ------------------------------------------------------------------------
> initializing NRLIB FOO for Foo
> compiling into NRLIB FOO
>
> >> System error:
> formatPred
>
> --
> 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 on the web visit https://groups.google.com/d/msgid/fricas-devel/1be66a29-5f1d-4bea-8793-2e0fadf85eb6%40hemmecke.org.

> )abbrev package FOO Foo
> Foo(C): Exports == Implementation where
> C: Field
> Exports ==> with
> foobar: () -> Pol C
> if C is Integer then
> foo: C -> Pol C
> Implementation ==> add
> foobar(): Pol C == error "FOO"


--
Waldek Hebisch

Ralf Hemmecke

unread,
May 16, 2024, 8:24:54 AM5/16/24
to fricas...@googlegroups.com
On 5/16/24 14:00, Waldek Hebisch wrote:
> Yes, this is limitation of current compiler. It would be relatively
> easy to allow more general conditions, but important part of
> current handling involves inference and inference is only
> implemented for 'has' and boolean combinations of 'has' conditions.

I hope you have noticed that the "is" construction works in the "add"
part, but not in the "with" part of the domain.

OK, I will rewrite my program.

Ralf

Waldek Hebisch

unread,
May 16, 2024, 8:38:35 AM5/16/24
to fricas...@googlegroups.com
Yes, I know. 'with' part needs more than 'add' part.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages