oldk1331 wrote:
>
> Another temporary fix is to add a rule in 'resolveTTSpecial'.
> We resolve these 2 types manually, but the automatic
> coercion will fail later, at least stack overflow is gone.
>
> diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot
> index dbe3a228..fc150670 100644
> --- a/src/interp/i-resolv.boot
> +++ b/src/interp/i-resolv.boot
> @@ -271,6 +271,9 @@ resolveTTSpecial(t1,t2) ==
> t1 is ['Polynomial,R] and t2 is ['Complex,S] =>
> containsPolynomial(S) => resolveTT1(['Polynomial,['Complex,R]],t2)
> ['Polynomial,['Complex,resolveTT1(R,S)]]
> + t1 is '(Expression (Complex (Integer))) and
> + t2 is '(Fraction (Polynomial (AlgebraicNumber))) =>
> + t1
> t1 is ['Expression, R] and t2 is ['Complex,S] =>
> dom' := resolveTT(R, t2)
> null dom' => nil
The patch below seem to be less hacky than what you propose.
In particular, it will cut this loop regardless of types
involved.
Index: src/interp/i-resolv.boot
===================================================================
--- src/interp/i-resolv.boot (revision 2353)
+++ src/interp/i-resolv.boot (working copy)
@@ -521,7 +521,11 @@
$Subst : local := NIL
$Coerce : local := 'T
m := SUBSTQ("**",$EmptyMode,m)
+ -- arbitrary limit
+ $resolve_level > 15 => nil
+ $resolve_level := $resolve_level + 1
tt := resolveTM1(t,m)
+ $resolve_level := $resolve_level - 1
result := tt and isValidType tt and tt
stopTimingProcess 'resolve
result
Index: src/interp/i-toplev.boot
===================================================================
--- src/interp/i-toplev.boot (revision 2353)
+++ src/interp/i-toplev.boot (working copy)
@@ -310,6 +310,8 @@
--type analyzes and evaluates expression x, returns object
$env:local := [[NIL]]
$genValue:local := true --evaluate all generated code
+ -- counter used to limit recursion depth during resolve
+ $resolve_level : local := 0
interpret1(x,nil,posnForm)
interpret1(x,rootMode,posnForm) ==
--
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 [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.