Feedback Thread: DIP 1040--Copying, Moving, and Forwarding--Community Review Round 1
Timon Gehr
timon.gehr at gmx.ch
Mon Mar 8 11:28:53 UTC 2021
On 08.03.21 11:21, Walter Bright wrote:
>>
>>
>> The way to cover all base is to go for a fixed point analysis. A fixed
>> point analysis approach would go ass follow: define a state for all
>> local variable, then follow the control flow updating the state of
>> said variable. When a merge happen in the control flow, verify that
>> both both path through which you arrive at the merge point have a
>> different state, then apply a fix and reprocess affected branches of
>> the control flow, up to the point all merge point are consistent - you
>> reached a fixed point.
>
> That's exactly how the @live analysis is currently implemented. I didn't
> know it was called a fixed point analysis.
The general framework is also called abstract interpretation, where the
merge operation is called a join of abstract elements. There's also a
meet operation that can introduce information from conditionals into the
state. (E.g. if you want to do value range propagation this can be
useful.) In general, abstract interpretation does not converge to a
fixed point in finite time, then you need to introduce some sort of
widening operator. In practice, this is often the main challenge to make
it work.
More information about the Digitalmars-d
mailing list