Skip to content

Commit

Permalink
removed misleading Def::is_recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
leissa committed Mar 3, 2025
1 parent 5da403a commit 60c6d0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions include/mim/def.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ class Def : public fe::RuntimeCast<Def> {

/// @name Free Vars and Muts
/// * local_muts() / local_vars() are cached and hash-consed.
/// * free_vars() are computed on demand and cached.
/// They will be transitively invalidated by following users, if a mutable is mutated.
/// * free_vars() are computed on demand and cached in mutables.
/// They will be transitively invalidated by following users(), if a mutable is mutated.
///@{

/// Mutables reachable by following *immutable* deps(); `mut->local_muts()` is by definition the set `{ mut }`.
Expand All @@ -407,9 +407,6 @@ class Def : public fe::RuntimeCast<Def> {
Muts users() { return muts_.users; } ///< Set of mutables where this mutable is locally referenced.
bool is_open() const; ///< Has free_vars()?
bool is_closed() const; ///< Has no free_vars()?
/// Detects simple but **not** mutual recursion.
/// @see Nest::Node::is_mutually_recursive()
bool is_recursive() { return mut_local_muts().contains(this); }
///@}

/// @name external
Expand Down
2 changes: 1 addition & 1 deletion src/mim/def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ template TExt<true >* TExt<true > ::stub_(World&, Ref);
*/

bool Def::is_immutabilizable() {
if (is_recursive()) return false;
if (mut_local_muts().contains(this)) return false;

if (auto v = has_var()) {
for (auto op : deps())
Expand Down

0 comments on commit 60c6d0d

Please sign in to comment.