HELP: Translated files, particularly ode2.lisp
- Subject: HELP: Translated files, particularly ode2.lisp
- From: David.Billinghurst at riotinto
- Date: Thu, 27 Mar 2003 22:54:19 -0600
I have been tinkering with first order odes. I was trying to integrate
my stuff into the existing ode2 routine but have struck a number of
issues.
1. The file src/ode2.lisp was translated from share/diffequations/ode2.mac
but there are no make rules to update the .lisp file if the .mac
file is modified. There are a number of other files affected by this.
It would be nice to automate this somehow.
2. When I translate ode2.mac the generated ode2.LISP the following lines of
text are appended
;;The following functions declaration should ;;go at the front of your macsyma file
;;EVAL_WHEN(TRANSLATE,
DECLARE_TRANSLATED(BOUNDTEST,NOTEQN,NLXY,NLY,NLX,XCC2,BESSEL2,
EULER2,PTTEST,EXACT2,CC2,GENHOM,SOLVEBERNOULLI,
SOLVEHOM,INTEGFACTOR,EXACT,SEPARABLE,SOLVELNR,
SOLVE1,LINEAR2,REDUCE,HOM2,PR2,VARP,DESIMP,
FAILURE,ODE1A,FTEST,ODE2A))
and I have to remove them manually. It would be nice to turn them of, or
have them added as comments. The manual indicates this can be controlled
by one of the TR_* flags. I haven't worked it out yet.
3. The translated lisp code (using clisp-2.28/cygwin) is wrong. I compared it
with the original lisp file. The attched changes to the freshly translated file,
get it working and passing the testsuite. I do not understand the changes I made,
and don't know how to progress from here.
--- ode2.LISP 2003-03-27 23:24:57.000000000 +1100
+++ ode2.lisp 2003-03-27 23:46:06.000000000 +1100
@@ -45,7 +45,7 @@
((MFUNCTION-CALL $FREEOF
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))
$EQ)
(COND
((MFUNCTION-CALL $FTEST
@@ -72,13 +72,13 @@
(MFUNCTION-CALL $COEFF $DE
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2))))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2)))))
(SETQ $A2
(SIMPLIFY
(MFUNCTION-CALL $COEFF $DE
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X)))))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X))))))
(SETQ $A3 (SIMPLIFY (MFUNCTION-CALL $COEFF $DE (TRD-MSYMEVAL $Y '$Y))))
(SETQ $A4
(SIMPLIFY
@@ -88,12 +88,12 @@
(MUL* $A1
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X)
- 2)))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)
+ 2))))
(MUL* (*MMINUS $A2)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X)))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X))))
(MUL* (*MMINUS $A3) (TRD-MSYMEVAL $Y '$Y))))))
(COND
((AND (MFUNCTION-CALL $PR2 $A1) (MFUNCTION-CALL $PR2 $A2)
@@ -134,7 +134,7 @@
(MFUNCTION-CALL $LINEAR2 $DE
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))))
+ , (TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))))
NIL)
(RETURN (MFUNCTION-CALL $FAILURE (TRD-MSYMEVAL $MSG2 '$MSG2) $EQ))))
(SETQ $DES (SIMPLIFY (MFUNCTION-CALL $DESIMP $DE)))
@@ -143,7 +143,7 @@
(MFUNCTION-CALL $SOLVE1 $DES
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X)))))))
+ , (TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X))))))
(COND
((MFUNCTION-CALL $FTEST (SIMPLIFY (MFUNCTION-CALL $SOLVELNR $DE)))
(RETURN (TRD-MSYMEVAL $%Q% '$%Q%))))
@@ -166,7 +166,7 @@
(MFUNCTION-CALL $LINEAR2 $DES
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))))
+ , (TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))))
NIL)
(RETURN (MFUNCTION-CALL $FAILURE (TRD-MSYMEVAL $MSG2 '$MSG2) $EQ))))
(COND
@@ -217,10 +217,10 @@
(MFUNCTION-CALL $FREEOF (TRD-MSYMEVAL $Y '$Y)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))
(TRD-MSYMEVAL $%F% '$%F%))))
(PROGN (DEFPROP $FTEST T TRANSLATED) (ADD2LNC '$FTEST $PROPS)
(DEFMTRFUN ($FTEST $BOOLEAN MDEFINE NIL NIL) ($CALL) (DECLARE (SPECIAL $CALL))
@@ -783,13 +783,13 @@
(LIST '(MEQUAL)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))
$QQ))
(SIMPLIFY
(LIST '(MEQUAL)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))
$QQ)))
$EQ)))
(COND
@@ -813,14 +813,14 @@
(LIST '(MEQUAL)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))
(SIMPLIFY
- `((%DERIVATIVE) (SYSTEM::UNQUOTE $V (TRD-MSYMEVAL $X '$X))))))
+ `((%DERIVATIVE), $V, (TRD-MSYMEVAL $X '$X)))))
(SIMPLIFY
(LIST '(MEQUAL)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))
$V)))
$EQ)))
(COND
@@ -837,7 +837,7 @@
(LIST '(MEQUAL) $V
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))))
(SIMPLIFY (LIST '(MEQUAL) $%C $%K1)))
$B)))
(RETURN
@@ -847,8 +847,8 @@
(MFUNCTION-CALL $NLXY $A1
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y)
- (TRD-MSYMEVAL $X '$X)))))))
+ , (TRD-MSYMEVAL $Y '$Y),
+ (TRD-MSYMEVAL $X '$X))))))
(SETQ $METHOD '$FREEOFY) (RETURN (TRD-MSYMEVAL $%Q% '$%Q%)))
(T (RETURN NIL))))))
'$DE '$B '$A1 '$V '$%K1 '$%C)))
@@ -865,13 +865,13 @@
(LIST '(MEQUAL)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
- (MUL* $V (SIMPLIFY `((%DERIVATIVE) (SYSTEM::UNQUOTE $V $YZ))))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))
+ (MUL* $V (SIMPLIFY `((%DERIVATIVE), $V, $YZ)))))
(SIMPLIFY
(LIST '(MEQUAL)
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))
+ ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))
$V))
(SIMPLIFY (LIST '(MEQUAL) (TRD-MSYMEVAL $Y '$Y) $YZ)))
$EQ)))
@@ -886,7 +886,7 @@
(LIST '(MEQUAL) $V
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X))))))
+ , (TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X)))))
(SIMPLIFY (LIST '(MEQUAL) $YZ (TRD-MSYMEVAL $Y '$Y)))
(SIMPLIFY (LIST '(MEQUAL) $%C $%K1)))
$B)))
@@ -897,8 +897,8 @@
(MFUNCTION-CALL $NLXY $A1
(SIMPLIFY
`((%DERIVATIVE)
- (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y)
- (TRD-MSYMEVAL $X '$X)))))))
+ , (TRD-MSYMEVAL $Y '$Y),
+ (TRD-MSYMEVAL $X '$X))))))
(SETQ $METHOD '$FREEOFX) (RETURN (TRD-MSYMEVAL $%Q% '$%Q%)))
(T (RETURN NIL))))))
'$DE '$B '$A1 '$YZ '$V '$%C '$%K1)))
@@ -1252,10 +1252,3 @@
(SETQ $MSG1 '|&Not a proper differential equation|)
(SETQ $MSG2 '|&First order equation not linear in y'|)
-;;The following functions declaration should ;;go at the front of your macsyma file
-;;EVAL_WHEN(TRANSLATE,
- DECLARE_TRANSLATED(BOUNDTEST,NOTEQN,NLXY,NLY,NLX,XCC2,BESSEL2,
- EULER2,PTTEST,EXACT2,CC2,GENHOM,SOLVEBERNOULLI,
- SOLVEHOM,INTEGFACTOR,EXACT,SEPARABLE,SOLVELNR,
- SOLVE1,LINEAR2,REDUCE,HOM2,PR2,VARP,DESIMP,
- FAILURE,ODE1A,FTEST,ODE2A))
\ No newline at end of file