aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/annacat.spad.pamphlet
blob: 70d5af6c39302ff6101356b21f1ca305fd692abd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/algebra annacat.spad}
\author{Brian Dupee}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{domain NIPROB NumericalIntegrationProblem}
<<domain NIPROB NumericalIntegrationProblem>>=
)abbrev domain NIPROB NumericalIntegrationProblem
++ Author: Brian Dupee
++ Date Created: December 1997
++ Date Last Updated: December 1997
++ Basic Operations: coerce, retract
++ Related Constructors: Union
++ Description:
++ \axiomType{NumericalIntegrationProblem} is a \axiom{domain}
++ for the representation of Numerical Integration problems for use
++ by ANNA. 
++
++ The representation is a Union of two record types - one for integration of
++ a function of one variable:
++
++ \axiomType{Record}(var:\axiomType{Symbol},
++ fn:\axiomType{Expression DoubleFloat},
++ range:\axiomType{Segment OrderedCompletion DoubleFloat},
++ abserr:\axiomType{DoubleFloat},
++ relerr:\axiomType{DoubleFloat},)
++
++ and one for multivariate integration:
++
++ \axiomType{Record}(fn:\axiomType{Expression DoubleFloat},
++ range:\axiomType{List Segment OrderedCompletion DoubleFloat},
++ abserr:\axiomType{DoubleFloat},
++ relerr:\axiomType{DoubleFloat},).
++

EDFA   ==> Expression DoubleFloat
SOCDFA ==> Segment OrderedCompletion DoubleFloat
DFA    ==> DoubleFloat
NIAA   ==> Record(var:Symbol,fn:EDFA,range:SOCDFA,abserr:DFA,relerr:DFA)
MDNIAA ==> Record(fn:EDFA,range:List SOCDFA,abserr:DFA,relerr:DFA)
 
NumericalIntegrationProblem():SetCategory with
    coerce: NIAA -> %
      ++ coerce(x) \undocumented{}
    coerce: MDNIAA -> %
      ++ coerce(x) \undocumented{}
    coerce: Union(nia:NIAA,mdnia:MDNIAA) -> %
      ++ coerce(x) \undocumented{}
    coerce: % -> OutputForm
      ++ coerce(x) \undocumented{}
    retract: % -> Union(nia:NIAA,mdnia:MDNIAA)
      ++ retract(x) \undocumented{}

  ==
 
    add
      Rep := Union(nia:NIAA,mdnia:MDNIAA)
 
      coerce(s:NIAA) == [s]
      coerce(s:MDNIAA) == [s]
      coerce(s:Union(nia:NIAA,mdnia:MDNIAA)) == s
      coerce(x:%):OutputForm ==
        (x) case nia => (x.nia)::OutputForm
        (x.mdnia)::OutputForm
      retract(x:%):Union(nia:NIAA,mdnia:MDNIAA) ==
        (x) case nia => [x.nia]
        [x.mdnia]

@
\section{domain ODEPROB NumericalODEProblem}
<<domain ODEPROB NumericalODEProblem>>=
)abbrev domain ODEPROB NumericalODEProblem
++ Author: Brian Dupee
++ Date Created: December 1997
++ Date Last Updated: December 1997
++ Basic Operations: coerce, retract
++ Related Constructors: Union
++ Description:
++ \axiomType{NumericalODEProblem} is a \axiom{domain}
++ for the representation of Numerical ODE problems for use
++ by ANNA. 
++
++ The representation is of type: 
++
++ \axiomType{Record}(xinit:\axiomType{DoubleFloat},
++ xend:\axiomType{DoubleFloat},
++ fn:\axiomType{Vector Expression DoubleFloat},
++ yinit:\axiomType{List DoubleFloat},intvals:\axiomType{List DoubleFloat},
++ g:\axiomType{Expression DoubleFloat},abserr:\axiomType{DoubleFloat},
++ relerr:\axiomType{DoubleFloat})
++

DFB   ==> DoubleFloat
VEDFB ==> Vector Expression DoubleFloat
LDFB  ==> List DoubleFloat
EDFB  ==> Expression DoubleFloat
ODEAB ==> Record(xinit:DFB,xend:DFB,fn:VEDFB,yinit:LDFB,intvals:LDFB,g:EDFB,abserr:DFB,relerr:DFB)
NumericalODEProblem():SetCategory with

    coerce: ODEAB -> %
      ++ coerce(x) \undocumented{}
    coerce: % -> OutputForm
      ++ coerce(x) \undocumented{}
    retract: % -> ODEAB
      ++ retract(x) \undocumented{}

  ==
 
    add
      Rep := ODEAB
 
      coerce(s:ODEAB) == s
      coerce(x:%):OutputForm ==
        (retract(x))::OutputForm
      retract(x:%):ODEAB == x :: Rep

@
\section{domain PDEPROB NumericalPDEProblem}
<<domain PDEPROB NumericalPDEProblem>>=
)abbrev domain PDEPROB NumericalPDEProblem
++ Author: Brian Dupee
++ Date Created: December 1997
++ Date Last Updated: December 1997
++ Basic Operations: coerce, retract
++ Related Constructors: Union
++ Description:
++ \axiomType{NumericalPDEProblem} is a \axiom{domain}
++ for the representation of Numerical PDE problems for use
++ by ANNA. 
++
++ The representation is of type: 
++
++ \axiomType{Record}(pde:\axiomType{List Expression DoubleFloat}, 
++ constraints:\axiomType{List PDEC}, 
++ f:\axiomType{List List Expression DoubleFloat},
++ st:\axiomType{String},
++ tol:\axiomType{DoubleFloat})
++
++ where \axiomType{PDEC} is of type:
++
++ \axiomType{Record}(start:\axiomType{DoubleFloat}, 
++ finish:\axiomType{DoubleFloat},
++ grid:\axiomType{NonNegativeInteger},
++ boundaryType:\axiomType{Integer},
++ dStart:\axiomType{Matrix DoubleFloat}, 
++ dFinish:\axiomType{Matrix DoubleFloat})
++

DFC   ==> DoubleFloat
NNIC  ==> NonNegativeInteger
INTC  ==> Integer
MDFC  ==> Matrix DoubleFloat
PDECC ==> Record(start:DFC, finish:DFC, grid:NNIC, boundaryType:INTC,
                dStart:MDFC, dFinish:MDFC)
LEDFC ==> List Expression DoubleFloat
PDEBC ==> Record(pde:LEDFC, constraints:List PDECC, f:List LEDFC, 
                    st:String, tol:DFC)
NumericalPDEProblem():SetCategory with

    coerce: PDEBC -> %
      ++ coerce(x) \undocumented{}
    coerce: % -> OutputForm
      ++ coerce(x) \undocumented{}
    retract: % -> PDEBC
      ++ retract(x) \undocumented{}

  ==
 
    add
      Rep := PDEBC
 
      coerce(s:PDEBC) == s
      coerce(x:%):OutputForm ==
        (retract(x))::OutputForm
      retract(x:%):PDEBC == x :: Rep

@
\section{domain OPTPROB NumericalOptimizationProblem}
<<domain OPTPROB NumericalOptimizationProblem>>=
)abbrev domain OPTPROB NumericalOptimizationProblem
++ Author: Brian Dupee
++ Date Created: December 1997
++ Date Last Updated: December 1997
++ Basic Operations: coerce, retract
++ Related Constructors: Union
++ Description:
++ \axiomType{NumericalOptimizationProblem} is a \axiom{domain}
++ for the representation of Numerical Optimization problems for use
++ by ANNA. 
++
++ The representation is a Union of two record types - one for otimization of
++ a single function of one or more variables:
++
++ \axiomType{Record}(
++ fn:\axiomType{Expression DoubleFloat},
++ init:\axiomType{List DoubleFloat},
++ lb:\axiomType{List OrderedCompletion DoubleFloat},
++ cf:\axiomType{List Expression DoubleFloat},
++ ub:\axiomType{List OrderedCompletion DoubleFloat})
++
++ and one for least-squares problems i.e. optimization of a set of
++ observations of a data set:
++
++ \axiomType{Record}(lfn:\axiomType{List Expression DoubleFloat},
++ init:\axiomType{List DoubleFloat}).
++

LDFD     ==> List DoubleFloat
LEDFD    ==> List Expression DoubleFloat
LSAD     ==> Record(lfn:LEDFD, init:LDFD)
UNOALSAD ==> Union(noa:NOAD,lsa:LSAD)
EDFD     ==> Expression DoubleFloat
LOCDFD   ==> List OrderedCompletion DoubleFloat
NOAD     ==> Record(fn:EDFD, init:LDFD, lb:LOCDFD, cf:LEDFD, ub:LOCDFD)
NumericalOptimizationProblem():SetCategory with

    coerce: NOAD -> %
      ++ coerce(x) \undocumented{}
    coerce: LSAD -> %
      ++ coerce(x) \undocumented{}
    coerce: UNOALSAD -> %
      ++ coerce(x) \undocumented{}
    coerce: % -> OutputForm
      ++ coerce(x) \undocumented{}
    retract: % -> UNOALSAD
      ++ retract(x) \undocumented{}

  ==
 
    add
      Rep := UNOALSAD
 
      coerce(s:NOAD) == [s]
      coerce(s:LSAD) == [s]
      coerce(x:UNOALSAD) == x
      coerce(x:%):OutputForm ==
        (x) case noa => (x.noa)::OutputForm
        (x.lsa)::OutputForm
      retract(x:%):UNOALSAD ==
        (x) case noa => [x.noa]
        [x.lsa]

@
\section{category NUMINT NumericalIntegrationCategory}
<<category NUMINT NumericalIntegrationCategory>>=
)abbrev category NUMINT NumericalIntegrationCategory
++ Author: Brian Dupee
++ Date Created: February 1994
++ Date Last Updated: March 1996
++ Description:
++ \axiomType{NumericalIntegrationCategory} is the \axiom{category} for 
++ describing the set of Numerical Integration \axiom{domains} with
++ \axiomFun{measure} and \axiomFun{numericalIntegration}.

EDFE   ==> Expression DoubleFloat
SOCDFE ==> Segment OrderedCompletion DoubleFloat
DFE    ==> DoubleFloat
NIAE   ==> Record(var:Symbol,fn:EDFE,range:SOCDFE,abserr:DFE,relerr:DFE)
MDNIAE ==> Record(fn:EDFE,range:List SOCDFE,abserr:DFE,relerr:DFE)
NumericalIntegrationCategory(): Category == SetCategory with

  measure:(RoutinesTable,NIAE)->Record(measure:Float,explanations:String,extra:Result)
    ++ measure(R,args) calculates an estimate of the ability of a particular
    ++ method to solve a problem.  
    ++
    ++ This method may be either a specific NAG routine or a strategy (such
    ++ as transforming the function from one which is difficult to one which
    ++ is easier to solve).
    ++
    ++ It will call whichever agents are needed to perform analysis on the
    ++ problem in order to calculate the measure. There is a parameter,
    ++ labelled \axiom{sofar}, which would contain the best compatibility
    ++ found so far.

  numericalIntegration: (NIAE, Result) -> Result
    ++ numericalIntegration(args,hints) performs the integration of the
    ++ function given the strategy or method returned by \axiomFun{measure}.

  measure:(RoutinesTable,MDNIAE)->Record(measure:Float,explanations:String,extra:Result)
    ++ measure(R,args) calculates an estimate of the ability of a particular
    ++ method to solve a problem.  
    ++
    ++ This method may be either a specific NAG routine or a strategy (such
    ++ as transforming the function from one which is difficult to one which
    ++ is easier to solve).
    ++
    ++ It will call whichever agents are needed to perform analysis on the
    ++ problem in order to calculate the measure. There is a parameter,
    ++ labelled \axiom{sofar}, which would contain the best compatibility
    ++ found so far.

  numericalIntegration: (MDNIAE, Result) -> Result
    ++ numericalIntegration(args,hints) performs the integration of the
    ++ function given the strategy or method returned by \axiomFun{measure}.

@
\section{category ODECAT OrdinaryDifferentialEquationsSolverCategory}
<<category ODECAT OrdinaryDifferentialEquationsSolverCategory>>=
)abbrev category ODECAT OrdinaryDifferentialEquationsSolverCategory
++ Author: Brian Dupee
++ Date Created: February 1995
++ Date Last Updated: June 1995
++ Basic Operations: 
++ Description:
++ \axiomType{OrdinaryDifferentialEquationsSolverCategory} is the 
++ \axiom{category} for describing the set of ODE solver \axiom{domains} 
++ with \axiomFun{measure} and \axiomFun{ODEsolve}.

DFF   ==> DoubleFloat
VEDFF ==> Vector Expression DoubleFloat
LDFF  ==> List DoubleFloat
EDFF  ==> Expression DoubleFloat
ODEAF ==> Record(xinit:DFF,xend:DFF,fn:VEDFF,yinit:LDFF,intvals:LDFF,g:EDFF,abserr:DFF,relerr:DFF)
OrdinaryDifferentialEquationsSolverCategory(): Category == SetCategory with

  measure:(RoutinesTable,ODEAF) -> Record(measure:Float,explanations:String)
    ++ measure(R,args) calculates an estimate of the ability of a particular
    ++ method to solve a problem.  
    ++
    ++ This method may be either a specific NAG routine or a strategy (such
    ++ as transforming the function from one which is difficult to one which
    ++ is easier to solve).
    ++
    ++ It will call whichever agents are needed to perform analysis on the
    ++ problem in order to calculate the measure. There is a parameter,
    ++ labelled \axiom{sofar}, which would contain the best compatibility
    ++ found so far.

  ODESolve: ODEAF -> Result
    ++ ODESolve(args) performs the integration of the
    ++ function given the strategy or method returned by \axiomFun{measure}.

@
\section{category PDECAT PartialDifferentialEquationsSolverCategory}
<<category PDECAT PartialDifferentialEquationsSolverCategory>>=
)abbrev category PDECAT PartialDifferentialEquationsSolverCategory
++ Author: Brian Dupee
++ Date Created: February 1995
++ Date Last Updated: June 1995
++ Basic Operations: 
++ Description:
++ \axiomType{PartialDifferentialEquationsSolverCategory} is the 
++ \axiom{category} for describing the set of PDE solver \axiom{domains} 
++ with \axiomFun{measure} and \axiomFun{PDEsolve}.

-- PDEA	==> Record(xmin:F,xmax:F,ymin:F,ymax:F,ngx:NNI,ngy:NNI,_
--             pde:List Expression Float, bounds:List List Expression Float,_
--             st:String, tol:DF)

--  measure:(RoutinesTable,PDEA) -> Record(measure:F,explanations:String)
--    ++ measure(R,args) calculates an estimate of the ability of a particular
--    ++ method to solve a problem.  
--    ++
--    ++ This method may be either a specific NAG routine or a strategy (such
--    ++ as transforming the function from one which is difficult to one which
--    ++ is easier to solve).
--    ++
--    ++ It will call whichever agents are needed to perform analysis on the
--    ++ problem in order to calculate the measure. There is a parameter,
--    ++ labelled \axiom{sofar}, which would contain the best compatibility
--    ++ found so far.

--  PDESolve: PDEA -> Result
--    ++ PDESolve(args) performs the integration of the
--    ++ function given the strategy or method returned by \axiomFun{measure}.

DFG   ==> DoubleFloat
NNIG  ==> NonNegativeInteger
INTG  ==> Integer
MDFG  ==> Matrix DoubleFloat
PDECG ==> Record(start:DFG, finish:DFG, grid:NNIG, boundaryType:INTG,
                  dStart:MDFG, dFinish:MDFG)
LEDFG ==> List Expression DoubleFloat
PDEBG ==> Record(pde:LEDFG, constraints:List PDECG, f:List LEDFG, 
                    st:String, tol:DFG)
PartialDifferentialEquationsSolverCategory(): Category == SetCategory with

  measure:(RoutinesTable,PDEBG) -> Record(measure:Float,explanations:String)
    ++ measure(R,args) calculates an estimate of the ability of a particular
    ++ method to solve a problem.  
    ++
    ++ This method may be either a specific NAG routine or a strategy (such
    ++ as transforming the function from one which is difficult to one which
    ++ is easier to solve).
    ++
    ++ It will call whichever agents are needed to perform analysis on the
    ++ problem in order to calculate the measure. There is a parameter,
    ++ labelled \axiom{sofar}, which would contain the best compatibility
    ++ found so far.

  PDESolve: PDEBG -> Result
    ++ PDESolve(args) performs the integration of the
    ++ function given the strategy or method returned by \axiomFun{measure}.

@
\section{category OPTCAT NumericalOptimizationCategory}
<<category OPTCAT NumericalOptimizationCategory>>=
)abbrev category OPTCAT NumericalOptimizationCategory
++ Author: Brian Dupee
++ Date Created: January 1996
++ Date Last Updated: March 1996
++ Description:
++ \axiomType{NumericalOptimizationCategory} is the \axiom{category} for 
++ describing the set of Numerical Optimization \axiom{domains} with
++ \axiomFun{measure} and \axiomFun{optimize}.

LDFH   ==> List DoubleFloat
LEDFH  ==> List Expression DoubleFloat
LSAH   ==> Record(lfn:LEDFH, init:LDFH)
EDFH   ==> Expression DoubleFloat
LOCDFH ==> List OrderedCompletion DoubleFloat
NOAH   ==> Record(fn:EDFH, init:LDFH, lb:LOCDFH, cf:LEDFH, ub:LOCDFH)
NumericalOptimizationCategory(): Category == SetCategory with
  measure:(RoutinesTable,NOAH)->Record(measure:Float,explanations:String)
    ++ measure(R,args) calculates an estimate of the ability of a particular
    ++ method to solve an optimization problem.  
    ++
    ++ This method may be either a specific NAG routine or a strategy (such
    ++ as transforming the function from one which is difficult to one which
    ++ is easier to solve).
    ++
    ++ It will call whichever agents are needed to perform analysis on the
    ++ problem in order to calculate the measure. There is a parameter,
    ++ labelled \axiom{sofar}, which would contain the best compatibility
    ++ found so far.

  measure:(RoutinesTable,LSAH)->Record(measure:Float,explanations:String)
    ++ measure(R,args) calculates an estimate of the ability of a particular
    ++ method to solve an optimization problem.  
    ++
    ++ This method may be either a specific NAG routine or a strategy (such
    ++ as transforming the function from one which is difficult to one which
    ++ is easier to solve).
    ++
    ++ It will call whichever agents are needed to perform analysis on the
    ++ problem in order to calculate the measure. There is a parameter,
    ++ labelled \axiom{sofar}, which would contain the best compatibility
    ++ found so far.

  numericalOptimization:LSAH -> Result
    ++ numericalOptimization(args) performs the optimization of the
    ++ function given the strategy or method returned by \axiomFun{measure}.

  numericalOptimization:NOAH -> Result
    ++ numericalOptimization(args) performs the optimization of the
    ++ function given the strategy or method returned by \axiomFun{measure}.

@
\section{License}
<<license>>=
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
--
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are
--met:
--
--    - Redistributions of source code must retain the above copyright
--      notice, this list of conditions and the following disclaimer.
--
--    - Redistributions in binary form must reproduce the above copyright
--      notice, this list of conditions and the following disclaimer in
--      the documentation and/or other materials provided with the
--      distribution.
--
--    - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--      names of its contributors may be used to endorse or promote products
--      derived from this software without specific prior written permission.
--
--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
--IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
--TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
--PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
--OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
--EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
--PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
--PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
--NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@
<<*>>=
<<license>>

<<domain NIPROB NumericalIntegrationProblem>>
<<domain ODEPROB NumericalODEProblem>>
<<domain PDEPROB NumericalPDEProblem>>
<<domain OPTPROB NumericalOptimizationProblem>>
<<category NUMINT NumericalIntegrationCategory>>
<<category ODECAT OrdinaryDifferentialEquationsSolverCategory>>
<<category PDECAT PartialDifferentialEquationsSolverCategory>>
<<category OPTCAT NumericalOptimizationCategory>>
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}