Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not recognizing quantifier over elements of array #66

Closed
bjkeller opened this issue Feb 1, 2017 · 0 comments
Closed

not recognizing quantifier over elements of array #66

bjkeller opened this issue Feb 1, 2017 · 0 comments
Assignees
Labels

Comments

@bjkeller
Copy link

bjkeller commented Feb 1, 2017

Toradocu generates the following condition method

// double org.apache.commons.math3.analysis.differentiation.DerivativeStructure.getPartialDerivative(int[] orders)
    public static boolean m12_p0(org.apache.commons.math3.analysis.differentiation.DerivativeStructure receiver12_p0, int[] orders) {
        // @param orders derivation orders with respect to each variable (if all orders are 0, the value is returned) ==> args[0]==0
        return orders == 0;
    }

for org.apache.commons.math3.analysis.differentiation.DerivativeStructure.getPartialDerivative

The @param comment indicates that the condition should be orders[i]==0 for all i, but the condition is testing if the whole array is zero.

This relates somewhat to issue #65 where Toradocu is also generating a condition where the types are not compatible.

@albertogoffi albertogoffi self-assigned this Feb 3, 2017
albertogoffi added a commit that referenced this issue Feb 3, 2017
…" predicates

Avoid to generate conditions that are indeed wrong because of the mismatch
between the subject type and the predicate translation. For example, if the
subject is of type boolean, a translation of the predicate like "==0" would
be considered wrong and discarded. At the moment, validity check of predicate
translations is implemented only for subjects that are method's arguments.

Also, predicates like "has zero length" on arrays are now correctly supported.

This change improves precision and recall.

Resolves: #65, #66, #67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants