ml4ai / automates

AutoMATES: Automated Model Assembly from Text, Equations, and Software
https://ml4ai.github.io/automates
Other
24 stars 9 forks source link

[PA]: Issue with GrFN generation while assigning in conditional block #276

Closed rsulli55 closed 2 years ago

rsulli55 commented 2 years ago

This was found while writing the if_else_statement unit test in #275. In the C file for that test, notice that variable a is assigned in the else branch, but it does not appear as the output of an assignment node in the GrFN. Furthermore, as a was assigned, it should come out of the interface block, but it does not. The CAST correctly has the assignment of a in the else branch of the first conditional.

Excerpt of relevant code:

if (a < b) {
        x = b;
        b = a;
    }
    // else should be taken
    else {
        x = a;
        a = b;
    }

Here are the CAST and GrFN pdfs created from the C file: if_else_statement--CAST.pdf if_else_statement--GrFN.pdf

rsulli55 commented 2 years ago

This is resolved when using the AnnCAST to GrFN pipeline.