%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright (C) 1994 Joergen Backelin
%%
%% Bergman is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY.  No author or distributor
%% accepts responsibility to anyone for the consequences of using it
%% or for whether it serves any particular purpose or works at all,
%% unless he says so in writing.  Refer to the Bergman General Public
%% License for full details.

%% Everyone is granted permission to copy, modify and redistribute
%% bergman, but only under the conditions described in the
%% Bergman General Public License.   A copy of this license is
%% supposed to have been given to you along with bergman so you
%% can know your rights and responsibilities.  It should be in a
%% file named copyright.  Among other things, the copyright notice
%% and this notice must be preserved on all copies.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% CREATED 1994-11-21

% The purpose of this is to make a start of an interface
% Reduce-Bergman.

SYMBOLIC;
OFF RAISE;
GLOBAL '(!*!&SharedPol!*!&);
SHARE !*!&SharedPol!*!&;

% Might be dangerous. If CADDR !*!&SharedPol!*!& = NIL, then
% substitutions should be performed. On the other hand, forming
% algebraic expressions for the input might be both time and
% space consuming.

% SHARE seems to be useless in true lisp syntax mode!

SYMBOLIC PROCEDURE TRANS(inpol);
 <<ALGEBRAIC !*!&SharedPol!*!& := inpol;
   IF CAR !*!&SharedPol!*!& = !*SQ
    THEN TRANSSQ(CADR !*!&SharedPol!*!&)
    ELSE TRANSSQ(SIMP(REVAL(inpol)))>>

% I would like to use my ordinary tree handling macros!
% Furthermore, I must use InVars or something, and might wish
% to use converter functions from inout or alg2lsp.

SYMBOLIC PROCEDURE TRANSSQ(sqinpol);
 BEGIN tail,lm,ret,tmptree,;
 IF NOT DENR(sqinpol) = 1
  THEN ERROR(99, "TRANSSQ error: argument has non 1 denominator");
 tail := NUMR(sqinpol);
 

