SF.net SVN: fricas:[2652] trunk

0 views
Skip to first unread message

wheb...@users.sourceforge.net

unread,
Mar 14, 2020, 3:08:11 PM3/14/20
to fricas...@googlegroups.com
Revision: 2652
http://sourceforge.net/p/fricas/code/2652
Author: whebisch
Date: 2020-03-14 19:08:06 +0000 (Sat, 14 Mar 2020)
Log Message:
-----------
Retractable implies Coercible in opposite direction

Modified Paths:
--------------
trunk/ChangeLog
trunk/src/algebra/coerce.spad
trunk/src/input/bugs2020.input

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2020-03-14 18:56:00 UTC (rev 2651)
+++ trunk/ChangeLog 2020-03-14 19:08:06 UTC (rev 2652)
@@ -1,5 +1,10 @@
2020-03-14 Waldek Hebisch <heb...@math.uni.wroc.pl>

+ * src/algebra/coerce.spad: Retractable implies
+ Coercible in opposite direction
+
+2020-03-14 Waldek Hebisch <heb...@math.uni.wroc.pl>
+
* src/algebra/modgcd.spad: Remove 'modularGcd'

2020-03-14 Waldek Hebisch <heb...@math.uni.wroc.pl>

Modified: trunk/src/algebra/coerce.spad
===================================================================
--- trunk/src/algebra/coerce.spad 2020-03-14 18:56:00 UTC (rev 2651)
+++ trunk/src/algebra/coerce.spad 2020-03-14 19:08:06 UTC (rev 2652)
@@ -57,9 +57,7 @@
++ A is retractable to B means that some elements of A can be converted
++ into elements of B and any element of B can be converted into an
++ element of A.
-RetractableTo(S : Type) : Category == with
- coerce : S -> %
- ++ coerce(a) transforms a into an element of %.
+RetractableTo(S : Type) : Category == CoercibleFrom(S) with
retractIfCan : % -> Union(S,"failed")
++ retractIfCan(a) transforms a into an element of S if possible.
++ Returns "failed" if a cannot be made into an element of S.
@@ -80,9 +78,7 @@
++ B is retractable from A means that some elements in A can be converted
++ into elements of B and any element of B can be converted into an
++ element of A.
-RetractableFrom(S : Type) : Category == with
- coerce : % -> S
- ++ coerce(a) transforms a into an element of S.
+RetractableFrom(S : Type) : Category == CoercibleTo(S) with
retractIfCan : S -> Union(%,"failed")
++ retractIfCan(a) transforms a into an element of % if possible.
++ Returns "failed" if a cannot be made into an element of %.

Modified: trunk/src/input/bugs2020.input
===================================================================
--- trunk/src/input/bugs2020.input 2020-03-14 18:56:00 UTC (rev 2651)
+++ trunk/src/input/bugs2020.input 2020-03-14 19:08:06 UTC (rev 2652)
@@ -49,4 +49,8 @@
i_form := fe2::InputForm
testTrue("(fe2 = interpret(i_form))@Boolean")

+testcase "CoercibleFrom"
+
+testTrue("Polynomial(Integer) has CoercibleFrom(Integer)")
+
statistics()

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Reply all
Reply to author
Forward
0 new messages