Skip to content

Make smarter choices about decompilation of AndOr and OrElse expressions which can't be differentiated #37

@GoogleCodeExporter

Description

@GoogleCodeExporter
Quotations involving && or || operators are captured as IfThenElse expressions. 
DerivedPatterns includes two patterns, AndAlso and OrElse which attempt to 
reverse engineer this form. But there are occasions when it doesn't get it 
right and specifically when a given expression matches both patterns.  For 
example

  1. false || false and false && true
  2. true || false and true && true

But we can make smarter decompilation choices based on short-circuiting 
knowledge. 

In the first case, we know "false || false" would be a better choice since 
"<expr> && true" is equivalent to just "<expr>" so "<expr> && true" with the 
literal "true" on the right hand side is an unlikely actual expression.

Similarly, in the second case, we know "true && true" is a better choice than 
"true || false".

Original issue reported on code.google.com by stephen....@gmail.com on 4 Jul 2011 at 2:09

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions