From: Mattias Nilsson
Subject: Modelling mathematical relations?
Date: 
Message-ID: <1157269304.990586.244740@p79g2000cwp.googlegroups.com>
I would appreciate any input I can get regarding modelling mathematical
relations on finite sets in CL. What I have in mind is manipulating
relations by extending/reducing them, handling standard properties such
as transitivity, symmetry, etc., and eventually be able to
graph/visualize them.

I'm thinking of starting from alists (the sets won't be extremely
large), but maybe there is some better representation for
handling/checking the relation properties and the visualization? Has
anyone here tried something like this already? Any general ideas or
practical pointers are more than welcome!

I'm more than willing to RTFM - my googling skills just aren't strong
enough to actually find TFM. (And I admit that I've been too lazy to
check if any of the mathematical applications on CLiki and in the CL
Directory contains anything useful...)

Mattias

From: Robert Dodier
Subject: Re: Modelling mathematical relations?
Date: 
Message-ID: <1157292249.341102.156840@p79g2000cwp.googlegroups.com>
Mattias Nilsson wrote:

> I would appreciate any input I can get regarding modelling
> mathematical relations on finite sets in CL.

The symbolic computation system Maxima (http://maxima.sourceforge.net)
has several functions for working with finite sets;
see http://maxima.sourceforge.net/docs/manual/en/maxima.html
and look for "Sets". Maxima is written in CL.

At present Maxima only recognizes explicitly enumerated sets,
although it would be very nice to extend it to handle sets
represented by symbols.

Incidentally Maxima's representation for a set is an expression of
the form (($SET) 1 2 3 A B C) which is displayed as {1, 2, 3, a, b, c}.
(Almost everything in Maxima is an expression, and an expression
is something like ((FOO) X Y Z). This representation is the origin of
Mathematica's head/tail business, by the way. The expression
is formatted for display according to a property associated with FOO,
or if there is none, as foo(x, y, z).)

If you want to follow up, the Maxima mailing list
(http://maxima.sourceforge.net/maximalist.html)
is the appropriate place.

Hope this helps,
Robert Dodier
From: Mattias Nilsson
Subject: Re: Modelling mathematical relations?
Date: 
Message-ID: <1157353957.755453.156020@i42g2000cwa.googlegroups.com>
Robert Dodier wrote:
> Mattias Nilsson wrote:
>
> > I would appreciate any input I can get regarding modelling
> > mathematical relations on finite sets in CL.
>
> The symbolic computation system Maxima (http://maxima.sourceforge.net)
> has several functions for working with finite sets;
> see http://maxima.sourceforge.net/docs/manual/en/maxima.html
> and look for "Sets". Maxima is written in CL.

The only function I could find there that deals with relations was
"equiv_classes", which naturally assumes that you have an equivalence
relation. What I have in mind is more of an interactive "relation
explorer", where the properties of the relation aren't decided
beforehand, and where even the set itself isn't fully specified.

Maybe I will get a bigger response if I say that I want to play with
directed graphs, instead of relations? Anyone?

Mattias
From: Robert Dodier
Subject: Re: Modelling mathematical relations?
Date: 
Message-ID: <1157411802.668073.236590@h48g2000cwc.googlegroups.com>
Mattias Nilsson wrote:

> Maybe I will get a bigger response if I say that I want to play with
> directed graphs, instead of relations? Anyone?

Sorry, I misunderstood what you are looking for.
The only Lisp code for working with graphs that I know of
is Martin Rubey's graphs.lisp --
http://www.mat.univie.ac.at/~rubey/Maxima/graphs.lisp
See also this message about it --
http://groups.google.com/group/comp.lang.lisp/msg/1a1637652cefc353?hl=en&
graphs.lisp calls a program named Pigale to render graphs for
display -- see http://pigale.sourceforge.net/.

graphs.lisp is not included in Maxima yet but I think I'll go
ahead and do that soon. If you have the time, I would be
interested to know what you would like to see different or
in addition; I can merge your comments, if any, into the Maxima wish
list.

Hope this helps
Robert Dodier
From: Thomas A. Russ
Subject: Re: Modelling mathematical relations?
Date: 
Message-ID: <ymiu03m9kqo.fsf@sevak.isi.edu>
You could take a look at KIF and some of the Ontolingua stuff:

http://www.logic.stanford.edu/kif/kif.html

http://www.ksl.stanford.edu/software/ontolingua/

For Ontolingua the procedure would be a bit more complicated, since you
would need to log into the browser (with a free account) and then look
at some of the existing ontologies.  Perhaps the one on ABSTRACT-ALGEBRA
would be a useful starting place.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: HL
Subject: Re: Modelling mathematical relations?
Date: 
Message-ID: <86slj4b5a2.fsf@agora.my.domain>
"Mattias Nilsson" <········@bredband.net> writes:

> I would appreciate any input I can get regarding modelling mathematical
> relations on finite sets in CL. What I have in mind is manipulating
> relations by extending/reducing them, handling standard properties such
> as transitivity, symmetry, etc., and eventually be able to
> graph/visualize them.
> 
Hello Matthias --

 I realize you asked for Lisp. I don't know of anything in
 Lisp. There's some stuff in Haskell, maybe:

http://www.cs.york.ac.uk/fp/darcs/Blobs/

 in conjunction with Cordellia Hall's Haskell library form the
 book Discrete Mathematics Using a Computer. It implements sets,
 equivalence relations, a proof checker and other things. It's written
 in LIterate progrmming style and it's fairly compact (amazing what
 functional languages can achive):

http://www.dcs.gla.ac.uk/~jtod/discrete-mathematics/

 Maybe, if you're hellbent on using Lisp, you can adapt the ideas...

 Or, you'll probably want to try  GAP - Groups, Algorithms, Programming -
a System for Computational Discrete Algebra

 http://www-gap.mcs.st-and.ac.uk/

 Hope this helps.

 H.
From: Michael D. Kersey
Subject: Re: Modelling mathematical relations?
Date: 
Message-ID: <450251e8$0$63830$a726171b@news.hal-pc.org>
Mattias Nilsson wrote:
> I would appreciate any input I can get regarding modelling mathematical
> relations on finite sets in CL. What I have in mind is manipulating
> relations by extending/reducing them, handling standard properties such
> as transitivity, symmetry, etc., and eventually be able to
> graph/visualize them.

You might consider using prolog (in Lisp). Prolog expresses relations 
easily and is excellent for handling graphs:
http://www.google.com/search?hl=en&q=prolog+graphs&btnG=Google+Search

Peter Norvig's book "Paradigms of Artificial Intelligence Programming" 
has an implementation of prolog in Lisp:
http://www.norvig.com/paip.html

Franz Lisp provides an enhanced version of that software with Allegro 
Common Lisp:
http://www.franz.com/support/documentation/8.0/doc/prolog.html