On Wed, Apr 03, 2024 at 05:19:03PM +0200, Ralf Hemmecke wrote:
> Hi Waldek,
> 
> I've now tried to compile all of FriCAS with your patch (adding the error3
> function to g-error.boot).
> 
> https://github.com/fricas/fricas/compare/master...hemmecke:fricas:wip/error3.patch
> 
> Branch "wip/error3" at my github repo:
> 
> https://github.com/hemmecke/fricas/tree/wip/error3
> 
> It aborts the compilation with the log below. Obiously while compiling (in
> parallel) the file xpfact.spad.
> 
> "master" compiled fine on that machine so the problem must come from your
> patch, but I do not see why this would be related.
> 
> Any hints?

Well, AFAICS this is one of limitations of current compiler: 'error'
gets special treatment, but only when it is translated to Boot
function called 'error'.  If you rename 'error3' to 'error', then
the file will compile.  But I expect that such rename will cause
trouble, so I do not think it is a practical solution.

BTW: my guess is that trouble is due to following pattern:

                piv2 = 0 => error "impossible 3"
                ...
                lf1 := rquo(rp, rw)
                lf1 := lf1 + nc2*lop

Thanks to special treatment of 'error' compiler knows that
lf1 is well defined at the end of this sequence.  But
without special treatment compiler thinks that 'lf1' may
be undefined when the sequence is finished.

One could work around this by giving lf1 and rf1 explicit
type declarations at start of 'lift1', like:

        lf1 : YDP
        rf1 : YDP

but this is somewhat suboptimal, as it needs more code and
weakens compiler checking.

> Ralf
> 
> ====================================================================
> 
>    compiling local lift1 : (FreeMonoid
> vl,XDistributedPolynomial(vl,Polynomial F),Integer,FreeMonoid
> vl,XDistributedPolynomial(vl,Polynomial
> F),Integer,F,XDistributedPolynomial(vl,Polynomial F),Boolean) ->
> Record(l_fac: XDistributedPolynomial(vl,Polynomial F),r_fac:
> XDistributedPolynomial(vl,Polynomial F),residual:
> XDistributedPolynomial(vl,Polynomial F),nsym: Union(Symbol,none))
>    Semantic Errors:
>       [1] algebraic_solution:  sol1 is BOTH a variable and a literal
> 
>    Warnings:
>       [1] top_split:  k has no value
>       [2] lexquo:  quotient has no value
>       [3] lexquo:  remainder has no value
>       [4] left_ext_GCD:  quotient has no value
>       [5] left_ext_GCD:  remainder has no value
>       [6] XDP_to_YDP:  k has no value
>       [7] XDP_to_YDP:  c has no value
>       [8] eval_YDP:  c has no value
>       [9] eval_YDP:  k has no value
>       [10] eval_YDP:  lt2 has no value
>       [11] rational_solution:  sol has no value
>       [12] overlap_steps:  res has no value
>       [13] lift1:  rdc has no value
>       [14] lift1:  ldc has no value
>       [15] lift1:  lf1 has no value
> 
> ****** comp fails at level 4 with expression: ******
> error in function lift1
> 
> (SEQ (|:=| (|:| |nsu| (|Union| (|Symbol|) "none")) "none")
>      (|:=| |lcw| (|restn| |lw| (- |d1| |j|))) (|:=| |rop| (|lquo| |rfy|
> |lcw|))
>      (IF (= |rop| 0)
>          (SEQ (|:=| |rf1p| (|lquo| |rp| |lw|))
>               (|:=| |rf1| (* (|::| (/ 1 |lc|) (|Polynomial| F)) |rf1p|))
>               (|:=| |rp| (- |rp| (* |lfy| |rf1|)))
>               (|:=| |lf1| (|rquo| |rp| |rw|))
>               (|exit| 1 (|:=| |rp| (- |rp| (* |lf1| |rfy|)))))
>          (SEQ (|:=| |rcw| (|firstn| |rw| |j|))
>               (|:=| |lop| (|rquo| |lfy| |rcw|))
>               (|:=| |row| (* |lw| (|maxdeg| |rop|)))
>               (|exit| 1
>                (IF (= |lop| 0)
>                    (SEQ (|:=| |lf1| (|rquo| |rp| |rw|))
>                         (|:=| |rp| (- |rp| (* |lf1| |rfy|)))
>                         (|:=| |rf1p| (|lquo| |rp| |lw|))
>                         (|:=| |rf1|
>                          (* (|::| (/ 1 |lc|) (|Polynomial| F)) |rf1p|))
>                         (|exit| 1 (|:=| |rp| (- |rp| (* |lfy| |rf1|)))))
>                    (SEQ (|:=| |low| (* (|maxdeg| |lop|) |rw|))
>                         (|exit| 1
>                          (IF (< |row| |low|)
>                              (SEQ (|:=| |lf1| (|rquo| |rp| |rw|))
>                                   (|:=| |rp| (- |rp| (* |lf1| |rfy|)))
>                                   (|:=| |rf1p| (|lquo| |rp| |lw|))
>                                   (|:=| |rf1|
>                                    (* (|::| (/ 1 |lc|) (|Polynomial| F))
>                                       |rf1p|))
>                                   (|exit| 1
>                                    (|:=| |rp| (- |rp| (* |lfy| |rf1|)))))
>                              (IF (< |low| |row|)
>                                  (SEQ (|:=| |rf1p| (|lquo| |rp| |lw|))
>                                       (|:=| |rf1|
>                                        (* (|::| (/ 1 |lc|) (|Polynomial| F))
>                                           |rf1p|))
>                                       (|:=| |rp| (- |rp| (* |lfy| |rf1|)))
>                                       (|:=| |lf1| (|rquo| |rp| |rw|))
>                                       (|exit| 1
>                                        (|:=| |rp| (- |rp| (* |lf1|
> |rfy|)))))
>                                  (IF |o_case|
>                                      (SEQ
>                                       (|:=| |ns| ((|Sel| (|Symbol|) |new|)))
>                                       (|:=| |nsu| |ns|)
>                                       (|:=| |nc|
>                                        ((|Sel| (|Polynomial| F) |monomial|)
> 1
>                                         |ns| 1))
>                                       (|:=| |oc| (|coefficient| |rp| |low|))
>                                       (|:=| |rf1p| (|lquo| |rp| |lw|))
>                                       (|:=| |rf1|
>                                        (* (|::| (/ 1 |lc|) (|Polynomial| F))
>                                           |rf1p|))
>                                       (|:=| |lf1| (|rquo| |rp| |rw|))
>                                       (|:=| |rf1| (+ |rf1| (* |nc| |rop|)))
>                                       (|:=| |lf1|
>                                        (- |lf1|
>                                           (*
>                                            (+
>                                             (|::| (/ |oc| |lc|)
>                                              (|Polynomial| F))
>                                             |nc|)
>                                            |lop|)))
>                                       (|exit| 1
>                                        (|:=| |rp|
>                                         (- (- |rp| (* |lfy| |rf1|))
>                                            (* |lf1| |rfy|)))))
>                                      (SEQ
>                                       (|:=| |oc| (|coefficient| |rp| |low|))
>                                       (|:=| |dif_p|
>                                        (- (* |lfy| |rop|) (* |lop| |rfy|)))
>                                       (|exit| 1
>                                        (IF (= |dif_p| 0)
>                                            (|error| "impossible 1")
>                                            (SEQ (|:=| |dw| (|maxdeg|
> |dif_p|))
>                                                 (|exit| 1
>                                                  (IF (>= |dw| |low|)
>                                                      (|error| "impossible
> 2")
>                                                      (SEQ
>                                                       (|:=| |dc|
>                                                        (|coefficient| |rp|
>                                                         |dw|))
>                                                       (|:=| (|:| |rdc| F) 0)
>                                                       (|:=| (|:| |ldc| F) 0)
>                                                       (|:=|
>                                                        (|:| |ldc0|
> 
> (|Polynomial| F))
>                                                        (SEQ
>                                                         (|:=| |rqu|
>                                                          (|lquo| |dw| |lw|))
>                                                         (|exit| 1
>                                                          (IF (|case| |rqu|
>                                                               "failed")
>                                                              0
>                                                              (SEQ
>                                                               (|:=| |rdc|
>                                                                (|ground|
> 
> (|coefficient|
>                                                                  |rop|
>                                                                  (@ |rqu|
> 
> (|FreeMonoid|
> 
> |vl|)))))
>                                                               (|exit| 1
>                                                                (* (/ 1 |lc|)
> 
> |dc|)))))))
>                                                       (|:=|
>                                                        (|:| |rdc0|
> 
> (|Polynomial| F))
>                                                        (SEQ
>                                                         (|:=| |lqu|
>                                                          (|rquo| |dw| |rw|))
>                                                         (|exit| 1
>                                                          (IF (|case| |lqu|
>                                                               "failed")
>                                                              0
>                                                              (SEQ
>                                                               (|:=| |ldc|
>                                                                (|ground|
> 
> (|coefficient|
>                                                                  |lop|
>                                                                  (@ |lqu|
> 
> (|FreeMonoid|
> 
> |vl|)))))
>                                                               (|exit| 1
>                                                                |dc|))))))
>                                                       (|:=| |piv2| (- |rdc|
> 1))
>                                                       (|exit| 1
>                                                        (IF (= |piv2| 0)
>                                                            (|error|
>                                                             "impossible 3")
>                                                            (SEQ
>                                                             (|:=| |nc2|
>                                                              (* (/ 1 |piv2|)
>                                                                 (+
>                                                                  (-
>                                                                   (- |dc|
> 
> |ldc0|)
>                                                                   |rdc0|)
>                                                                  (* |ldc|
> 
> |oc|))))
>                                                             (|:=| |nc1|
>                                                              (- (- |oc|)
>                                                                 |nc2|))
>                                                             (|:=| |rf1p|
>                                                              (|lquo| |rp|
>                                                               |lw|))
>                                                             (|:=| |rf1|
>                                                              (*
>                                                               (|::| (/ 1
> |lc|)
> 
> (|Polynomial|
>                                                                 F))
>                                                               |rf1p|))
>                                                             (|:=| |rf1|
>                                                              (+ |rf1|
>                                                                 (* |nc1|
>                                                                    |rop|)))
>                                                             (|:=| |lf1|
>                                                              (|rquo| |rp|
>                                                               |rw|))
>                                                             (|:=| |lf1|
>                                                              (+ |lf1|
>                                                                 (* |nc2|
>                                                                    |lop|)))
>                                                             (|exit| 1
>                                                              (|:=| |rp|
>                                                               (-
>                                                                (- |rp|
>                                                                   (* |lfy|
> 
> |rf1|))
>                                                                (* |lf1|
> 
> |rfy|)))))))))))))))))))))))
>      (|exit| 1 (|construct| | << lf1 >> | |rf1| |rp| |nsu|)))
> ****** level 4  ******
> $x:= lf1
> $m:= $EmptyMode
> $f:=
> ((((|nsu| #) (|rdc0| #) (|ldc| #) (|ldc0| #) ...)
>   ((|rop| #) (|lcw| #) (|nsu| # #) (|o_case| # #) ...)
>   ((|overlap_steps| #) (|#| #) (< #) (<= #) ...)
>   ((|my_mul| #) (|get_algebraic_solution| #)) ...))
> 
>    >> Apparent user error:
>    NoValueMode
>     is an unknown mode
> 
> (1) -> cp XPFACT.NRLIB/XPFACT.fasl
> /dev/shm/hemmecke/fricas/b/target/x86_64-linux-gnu/algebra/XPFACT.fasl.tmp
> cp: cannot stat 'XPFACT.NRLIB/XPFACT.fasl': No such file or directory
> make[4]: *** [spad.mak:12205:
> /dev/shm/hemmecke/fricas/b/target/x86_64-linux-gnu/algebra/XPFACT.fasl]
> Error 1
> make[4]: Leaving directory '/dev/shm/hemmecke/fricas/b/src/algebra'
> make[3]: *** [Makefile:714: do-update-spads] Error 2
> make[3]: Leaving directory '/dev/shm/hemmecke/fricas/b/src/algebra'
> make[2]: *** [Makefile:586: all-ax] Error 2
> make[2]: Leaving directory '/dev/shm/hemmecke/fricas/b/src/algebra'
> make[1]: *** [Makefile:243: all-algebra] Error 2
> make[1]: Leaving directory '/dev/shm/hemmecke/fricas/b/src'
> make: *** [Makefile:250: all-src] Error 2
> 
> real  2m4,195s
> user  14m47,877s
> sys   1m18,482s
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/fricas-devel/b3ded5b9-391d-428f-b66f-65effde04b16%40hemmecke.org.

-- 
                              Waldek Hebisch

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/Zg2GzwhjqKEKJRSp%40fricas.org.

Reply via email to