The inverse of a function...

Corrado Santoro csanto@REDACTED
Wed Mar 10 15:55:34 CET 2004


Hi all,
I saw that my question started a very interesting discussion.. fine!
Anyway I think that the solution provided by Erik solves my problem.
Indeed probably my question was a little bit wrong.

Saying "inverse of a function f()" means to find a function "g()" that,
given a value returned by f(), returns the associated input. This could
be always possible if the function is "invertible".

My problem was a little bit different because I would like to know only
the "domain of function f()", i.e. the list of atoms that defines f()
clauses (Yes, my initial question was wrong!)

And Erik's solution seems to be OK for this problem. Also the "trial and
error" approach is OK.

Thus... thank you Erik, and all of you too for the suggestions and the
discussion!

Bye,
-Corrado




On Wed, 2004-03-10 at 13:12, Vlad Dumitrescu wrote:
> Hi,
> 
> > Functions without side-effects have an inverse, but
> > even if one is given the source code, it is not always
> > easy to identify the inverse. 
> 
> To be picky, not really :-)
> 
> For example,
> 
> f(a) -> aa;
> f(b) -> aa.
> 
> /Vlad
-- 
======================================================
Eng. Corrado Santoro, Ph.D.

University of Catania - Engineering Faculty
Department of Computer Science and
Telecommunications Engineering
Viale A. Doria, 6 - 95125 CATANIA (ITALY)

Tel: +39 095 7382364           Fax: +39 095 7382397
     +39 095 7382365
     +39 095 7382380

EMail: csanto@REDACTED
Personal Home Page:
            http://www.diit.unict.it/users/csanto

NUXI Home Page:
            http://nuxi.iit.unict.it
======================================================





More information about the erlang-questions mailing list