I've got one of these FriCAS compiler error messages that seems to take hours and I still cant see what’s wrong. I expect I have made some silly mistake but it seems so hard to find from the error message.

Does anyone know what would cause the following error message?
What is the difference is between a given type and the type in parenthesis?

The error message is:

   compiling exported chain : $ -> ChainComplex
****** comp fails at level 2 with expression: ******
error in function chain

(SEQ
 (LET (|:| |dc| (|DeltaComplex| VS))
   (|deltaComplex| (|pretend| |s| (|FiniteSimplicialComplex| VS))))
 | << |
 (LET (|:| |cc| (|ChainComplex|))
   ((|Sel| (|DeltaComplex| VS) |chain|) |dc|))
 | >> | (|exit| 1 |cc|))
****** level 2  ******
$x:= (LET (: cc (ChainComplex)) ((Sel (DeltaComplex VS) chain) dc))
$m:= NoValueMode
$f:=
((((|dc| # #) (|s| # #) (|concatIfNewArrow| #))
  ((|concatIfNewArrow| #) (|#| #) (< #) (<= #) ...)
  ((|concatIfNew| #) (|#| #) (< #) (<= #) ...)
  ((|listUnion| #) (|#| #) (< #) (<= #) ...) ...))

   >> Apparent user error:
   CANNOT ASSIGN: ((Sel (DeltaComplex VS) chain) dc)
   OF MODE: ChainComplex
   TO: cc
   OF MODE: (ChainComplex)

This error comes when compiling the following code:

   -- returns a matrix sequence representing the face maps
   -- in linear algebra form
   chain(s:%):ChainComplex ==
dc:DeltaComplex(VS) := deltaComplex(s pretend FiniteSimplicialComplex(VS))
     cc:ChainComplex := chain(dc)$DeltaComplex(VS)
     cc

This function is in the domain FiniteSimplicialComplex. Its not recursive, the chain function it calls is in a different domain. Its just a very simple convenience function so that the end user does not have to explicitly create an instance of DeltaComplex.

My gut feeling is that this is because ChainComplex and DeltaComplex are forward references to domains defined later in the same file. Because of this I compile first with $bootStrapMode := true. This works and I get:

(1) -> )disp op chain

There are 2 exposed functions called chain :
   [1] DeltaComplex(D2) -> ChainComplex from DeltaComplex(D2) if D2 has
            VERTS
   [2] FiniteSimplicialComplex(D2) -> ChainComplex
            from FiniteSimplicialComplex(D2) if D2 has VERTS

But then when I compile with $bootStrapMode := false I get the error.

As I say, I have probably made some silly error but finding these small errors gets frustrating and time consuming. Can anyone see what is wrong?

Martin B

--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to