Re: Determining the inverse function operation from a function definition

"Dr. Diettrich" <drdiettrich@compuserve.de>
28 Apr 2005 14:56:45 -0400

          From comp.compilers

Related articles
Determining the inverse function operation from a function definition rlfoster1@cox.net (Ron Foster) (2005-04-26)
Re: Determining the inverse function operation from a function definit torbenm@diku.dk (2005-04-28)
Re: Determining the inverse function operation from a function definit mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2005-04-28)
Re: Determining the inverse function operation from a function definit lfinsto1@gwdg.de (Laurence Finston) (2005-04-28)
Re: Determining the inverse function operation from a function definit wyrmwif@tsoft.org (SM Ryan) (2005-04-28)
Re: Determining the inverse function operation from a function definit drdiettrich@compuserve.de (Dr. Diettrich) (2005-04-28)
Re: Determining the inverse function operation from a function definit nmm1@cus.cam.ac.uk (2005-04-30)
Re: Determining the inverse function operation from a function definit gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-04-30)
Re: Determining the inverse function operation from a function definit drdiettrich@compuserve.de (Dr. Diettrich) (2005-05-13)
| List of all articles for this month |

From: "Dr. Diettrich" <drdiettrich@compuserve.de>
Newsgroups: comp.compilers
Date: 28 Apr 2005 14:56:45 -0400
Organization: Compilers Central
References: 05-04-067
Keywords: theory
Posted-Date: 28 Apr 2005 14:56:45 EDT

Ron Foster wrote:
>
> Hi.
> I am working on a small project to evaluate and execute unit conversion
> expressions. I started wondering whether it was possible to determine what
> the reverse conversion rules might blook like.
>
> For example, one might want to define the classic Celsius to Fahrenheit
> convesrion expression along the lines of:
>
> F( c ) = ( 9 / 5 ) * c + 32.
>
> It seems as though there's enough information there to deduce the inverse
> Fahrenheit to Celsius conversion:
>
> C( f ) = ( f - 32 ) / ( 5 / 9 )


Using my school math the result should read:
    C( f ) = ( f - 32 ) / ( 9 / 5 )


You can build an expression tree and implement a transformation
procedure for the reverse expression. Using an appropriate language
with built-in list manipulation will simplify things a lot. I remember
one of my first LISP exercises, a conversion from/to RPN...


Things will become a bit more complicated with exponentiation, sine,
or other non-linear functions, which may require more complex
transformations.


IMO you better ask your questions in a math group. Even if your problem
is related to "symbol manipulation" or "transformation", it's not a
matter of compilers nor grammars.


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.