[Openmcl-devel] inverse function

Robert Goldman rpgoldman at sift.info
Sat Feb 13 20:22:57 UTC 2010


In its most general form, what you're asking for here, even with your provisos could solve the halting problem,  so we need a more restricted spec to get something feasible. 
Best,
R

Taoufik Dachraoui <taoufik at mazeboard.com> wrote:

>Hi
>
>....
>> (defun square (x)
>>  (* x x))
>>
>> (inverse #'square) => #'sqrt ;; or something very like sqrt
>>
>> (funcall (inverse #'square) (square -3)) => 3 ;; i.e., not -3 as it you
>want it to
>
>I would like an inverse function that returns all possible values
>
>? (funcall (inverse #'square) 4)
>(2 -2)
>
>
>Many lisp functions are invertable and many are not as in Mathematics.
>
>What I would like to have is a function to generate an inverse of a given
>lisp function
>(without side-effects) if it has an inverse and the generated inverse
>function returns
>all possible results (as in sqrt above).
>
>The inverse generator will fail for many functions with side-effects or
>functions
>that do not have an inverse, but will return an inverse function for all
>others.
>
>The generated function, as said above, will return all possibilities.
>
>
>Kind regards
>Taoufik
>_______________________________________________
>Openmcl-devel mailing list
>Openmcl-devel at clozure.com
>http://clozure.com/mailman/listinfo/openmcl-devel


More information about the Openmcl-devel mailing list