Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

feat: purity analysis for chained functions and simple cyclic functions #203

Merged
merged 288 commits into from
Jan 3, 2024

Conversation

lukarade
Copy link
Contributor

@lukarade lukarade commented Dec 18, 2023

Closes #77

Summary of Changes

This feature adds the last part of the purity analysis:

  • We now build a topologically sorted graph and filter out simple cyclic function calls.
  • then we infer the purity/(impurity) for all functions in that call graph
  • if a function is impure, we also collect all reasons for its impurity
  • we use caching to store already computed functions and look them up when needed

There are still a few things that need improvement:

  • Nested cyclic functions
  • member access
  • further analysis of unknown reasons for impurity

lukarade and others added 30 commits May 24, 2023 23:42
@lukarade lukarade marked this pull request as ready for review December 22, 2023 01:06
@lukarade lukarade requested a review from a team as a code owner December 22, 2023 01:06
@lukarade
Copy link
Contributor Author

lukarade commented Jan 2, 2024

If this is merged, also merge #204 - it fixes all docstrings.

@lukarade lukarade self-assigned this Jan 2, 2024
@lukarade lukarade added the purity Inferring the purity of functions label Jan 2, 2024
@lars-reimann lars-reimann merged commit e1b4c57 into main Jan 3, 2024
@lars-reimann lars-reimann deleted the purity-analysis branch January 3, 2024 20:00
lars-reimann pushed a commit that referenced this pull request Jan 12, 2024
### Summary of Changes

- Fixed existing Docstrings to follow the numbydoc style guide
- Added all missing Docstrings for all classes and functions

**Only merge after #203**

---------

Co-authored-by: megalinter-bot <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
purity Inferring the purity of functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Second Iteration for Purity-analysis
3 participants