From 8519b9831708f14b575d7896ac5d31a393d547f7 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 31 Jan 2009 03:30:43 +0000 Subject: Fix AW/83 * interp/i-coerfn.boot (Dmp2P): Scalar tag is 0 for Polynomial T. * testsuite/interpreter/aw-83.input (a): New. --- src/ChangeLog | 7 +++++++ src/interp/i-coerfn.boot | 7 +++++-- src/testsuite/interpreter/aw-83.input | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/testsuite/interpreter/aw-83.input diff --git a/src/ChangeLog b/src/ChangeLog index a3e20d81..0001fc28 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2009-01-30 Waldek Hebisch + Gabriel Dos Reis + + Fix AW/83 + * interp/i-coerfn.boot (Dmp2P): Scalar tag is 0 for Polynomial T. + * testsuite/interpreter/aw-83.input (a): New. + 2009-01-29 Gabriel Dos Reis * OpenAxiom 1.2.1 Released. diff --git a/src/interp/i-coerfn.boot b/src/interp/i-coerfn.boot index e5d2da93..5ee715f0 100644 --- a/src/interp/i-coerfn.boot +++ b/src/interp/i-coerfn.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2008, Gabriel Dos Reis. +-- Copyright (C) 2007-2009, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -223,7 +223,10 @@ Dmp2P(u, source is [dmp,vl, S], target is [.,T]) == -- slight optimization for case #u = 1, #vl =1 and S=T -- I know it's pathological, but it may avoid an instantiation (1 = #u) and (1 = #vl) and (S = T) => - (lexp:= (CAAR u).0) = 0 => [1,:CDAR u] + -- The Rep of Polynomial T is a 2-branched Union with scalar + -- (coefficient ring values) first (tag = 0), and non-trivial + -- polynomials second (tag = 1). + (lexp:= (CAAR u).0) = 0 => [0,:CDAR u] [1,vl.0,[lexp,0,:CDAR u]] vl' := reverse MSORT vl diff --git a/src/testsuite/interpreter/aw-83.input b/src/testsuite/interpreter/aw-83.input new file mode 100644 index 00000000..9cba9a25 --- /dev/null +++ b/src/testsuite/interpreter/aw-83.input @@ -0,0 +1,5 @@ +-- +-- AW/83 +a := 1::DMP(['x],INT) +a :: POLY INT -- used to cause trouble + -- cgit v1.2.3