comp.lang.ada
 help / color / mirror / Atom feed
* Ann: symbolic multinomial algebra
@ 2004-05-31 22:56 tmoran
  2004-06-01  4:52 ` tmoran
  2004-06-02 22:53 ` Craig Carey
  0 siblings, 2 replies; 4+ messages in thread
From: tmoran @ 2004-05-31 22:56 UTC (permalink / raw)


I couldn't find a simple, easy to integrate, symbolic algebra
package, so I've posted one at http://home.comcast.net/~twmoran
The sample program includes the Knuth 2.2.4 example:
  type Vars is (x,y);
  function Image(Var : Vars) return String is ...
  package Polys is new Multinom(Vars, Image);
  use Polys;
  A : Polys.Multinomials
        := X**4 + 2.0*x**3*y**1 + 3.0*x**2*y**2 + 4.0*x**1*y**3 + 5.0*y**4;
  B : Polys.Multinomials := x**2 - 2.0*x**1*y**1 + y**2;
  ...
  Put_Line("Product is " & Image(A*B));



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ann: symbolic multinomial algebra
  2004-05-31 22:56 Ann: symbolic multinomial algebra tmoran
@ 2004-06-01  4:52 ` tmoran
  2004-06-02 22:53 ` Craig Carey
  1 sibling, 0 replies; 4+ messages in thread
From: tmoran @ 2004-06-01  4:52 UTC (permalink / raw)


It's been pointed out to me that package Sorts was missing from
http://home.comcast.net/~twmoran/multinom.zip
That's now corrected.  Sorry.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ann: symbolic multinomial algebra
  2004-05-31 22:56 Ann: symbolic multinomial algebra tmoran
  2004-06-01  4:52 ` tmoran
@ 2004-06-02 22:53 ` Craig Carey
  2004-06-03 11:33   ` Craig Carey
  1 sibling, 1 reply; 4+ messages in thread
From: Craig Carey @ 2004-06-02 22:53 UTC (permalink / raw)


On Mon, 31 May 2004 22:56:58 GMT, tmoran@acm.org wrote:

>I couldn't find a simple, easy to integrate, symbolic algebra
>package, so I've posted one at http://home.comcast.net/~twmoran
>The sample program includes the Knuth 2.2.4 example:
...
>  B : Polys.Multinomials := x**2 - 2.0*x**1*y**1 + y**2;
>  ...
>  Put_Line("Product is " & Image(A*B));


I have an Ada 95 symbolic algebra program ('Tope') targetted to solve
linear quantifier elimination problems such as this:

  Inp: (Exists x)(a<x)(b<=x)(x<=c)(x<=d)
  Out: (a<c)(a<d)(b<=c)(b<=d)

Online at: http://www.ijs.co.nz/code/software.html
The Ada Yacc parser with UMASS extensions is used.

The existing REDLOG led into a breakdown in failing to simplify the
symbolic output "Exists", and better could by using an operations
research algorithm to compute dual polytopes thrice.

The dual polytope can be computed with the Chernikova algorithm
of Mr LeVerge of 'irisa.fr', which is a small hard-to-port C program
online here (at the Parma Polyhedra website):
   http://www.cs.unipr.it/ppl/Documentation/chernikova.c
   (Mentioned on http://www.cs.unipr.it/ppl/Credits/ )
It is curious how such a tiny 'satisfactory' C program can be at the
centre of a lack of good progress of C programmers and also really quite
hard to port to good Ada code.

The Italian research project is testing out the use of a C++ style for
the syntax interface.
At Irisa (France), the Polka project uses real Ocaml for the front end
which actually wouldn't compile for me: 
   http://www.irisa.fr/prive/bjeannet/newpolka.html

The symbols are Real-valued.

---------

I got my Fast Strings package fixed: it speeded up by a staggeringly
large factor of 5.3 times when I replaced
    Str : String:
    ...
    Str := ...
with a call to C memmove() routine. It far from obvious that a CPU
cache size explanation would explain the (somewhat tricky-to-reproduce)
problem with performance.
Custom string package replacing Ada.Strings.Unbounded might be better if
avoiding the ":=" (some prob not required by Ada 95's RM7.6 rule saying
that no program can implement ":=" while seeing both variables for
good reasons that CLA might never get).



Craig Carey




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ann: symbolic multinomial algebra
  2004-06-02 22:53 ` Craig Carey
@ 2004-06-03 11:33   ` Craig Carey
  0 siblings, 0 replies; 4+ messages in thread
From: Craig Carey @ 2004-06-03 11:33 UTC (permalink / raw)





On Thu, 03 Jun 2004 10:53:18 +1200, Craig Carey wrote:
...
Correction: that software URL I gave ought to have ended in ".htm", and
not in ".html".

...
>   http://www.cs.unipr.it/ppl/Documentation/chernikova.c
>   (Mentioned on http://www.cs.unipr.it/ppl/Credits/ )
>It is curious how such a tiny 'satisfactory' C program can be at the
>centre of a lack of good progress of C programmers and also really quite
>hard to port to good Ada code.

Whoops: that's disputable and vague over what 'progress' for dual
polytope projects including: Cdd, Polka, Parma,
 http://www.cs.umd.edu/projects/omega/ ? [integers QE], Polylib, etc.
Cdd duals: http://www.cs.mcgill.ca/~fukuda/soft/cdd_home/cdd.html

My 'hard to port' seems a bit incorrect and it was about cutting 2
C arrays to leave 4 Ada matrices.


Craig Carey



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-03 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-31 22:56 Ann: symbolic multinomial algebra tmoran
2004-06-01  4:52 ` tmoran
2004-06-02 22:53 ` Craig Carey
2004-06-03 11:33   ` Craig Carey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox