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

doesNotUseRecursion fix #947

Merged
merged 8 commits into from
Apr 13, 2022
Merged

doesNotUseRecursion fix #947

merged 8 commits into from
Apr 13, 2022

Conversation

tfloxolodeiro
Copy link
Contributor

Al final nos dimos cuenta que el problema no era el AST que estabamos generando sino que la expectativa de doesNotUseRecursion.

Por lo que entendemos, esta expectativa:

through `A` ! calls `A`

En este workspace:

image

El through checkea que exista algun scope transitivo al procedimiento A donde ocurra que no se llama a A. Esto ocurre en el procedimiento A, donde no se esta llamando a A, por lo que la expectativa pasa.

Por esto, al poner el not abarcando todo el through estamos checkeando lo que queremos, que es que nunca desde el procedimiento se llegue a llamar a A.

Respecto al otro caso, que era que las llamadas recursivas no estaban siendo contadas como hacer algo, esto parece ser algo propio de Mulang porque al hacer, por ejemplo, within `A` count(calls `A`) >= 1, mulang ahi si detecta las llamadas a del procedimiento a si mismo, pero al hacer within `A` count(calls) >= 1 no.

@tfloxolodeiro tfloxolodeiro requested a review from a team as a code owner April 6, 2022 18:20
@ezequielPereyra
Copy link
Contributor

ezequielPereyra commented Apr 7, 2022

Muy bien análisis! Gracias por la mano!

Con respecto a los count, qué quieren hacer? Podríamos hacer nuestro propio count que tenga en cuenta los llamados recursivos y que los cuente. Creo que con eso podrían pasar los tests que quedaron comentados. Me imagino algo como:

`within ${toEDLString(declaration)} count(calls) + count(calls ${toEDLString(declaration)})`

app/utils/expectations.js Outdated Show resolved Hide resolved
Comment on lines 33 to 35
const countWithRecursiveCalling = (declaration) =>
`within ${toEDLString(declaration)} count(calls) + count(calls ${toEDLString(declaration)})`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debería llamarse countCallsWithin y adentro tener un comentario que explique este problema

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargar pregunta/issue en mulang ¿por qué el count(calls) no incluye las recursivas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@asanzo asanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@asanzo asanzo merged commit 55c5467 into no-recursion Apr 13, 2022
@asanzo asanzo deleted the fixing-ast branch April 13, 2022 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants