[cfe-commits] [PATCH] Expressions have lvalues and rvalues

Sebastian Redl sebastian.redl at getdesigned.at
Sat Oct 11 09:25:29 PDT 2008


Zhongxing Xu wrote:
> Hi Sebastian,
>
> I know where the confusion comes from: we are from two different 
> points of view. You are from pure programming language and compiler 
> point of view. I am from a mathematical interpretation of programs 
> point of view.
>
> [snip]
> Remember we are doing static analysis, and we are going to use some 
> mathematics to analyze program. So what objects are we processing in 
> mathematics? They are the value in the memory, i.e. the value on the 
> rightmost of the tuple. Literally they are raw bits. But we made them 
> more abstract into RVal. Furthermore, we noticed that the most 
> essential distinction among these varous abstract values (RVals) is 
> that some of them are address value, some of them are not. So here 
> comes LVal and NonLVal. We use LVal to represent an abstract address 
> value, and NonLVal to represent an numerical value.
>
> So, LVal and NonLVal are used to represent the abstract values in the 
> mathmatical sense, that has nothing to do with expressions in the 
> programming language sense. We need these mathematical values in our 
> symbolic analysis of the program. They are conceptly values stored in 
> our simulated computer memory. They are in a different world from 
> C/C++ expressions.
>
> An expression's lvalue evaluates (through our interpretation) into a LVal.
> An expression's rvalue evaluates (through our interpretation) into a 
> NonLVal (e.g. 2*x+3), or a LVal (e.g. &x).
>

So how about calling them Address and NonAddress? This would get rid of 
the dangerous similarity between LVal and LValue.

Sebastian



More information about the cfe-commits mailing list