Skip to content

Removing the assprime.{cpp,hpp} file in the Macaulay2 engine #4342

@andrew-tawfeek

Description

@andrew-tawfeek

Mike made the comment of wanting to remove assprime because it had been replaced by newer/faster algorithms. I had Codex assist in finding the dependencies and usage across M2 and the engine, and it seems that (currently) it is not immediately easy to remove and requires us to go in and update some algorithms with newer code. Codex response below.


I traced computations/assprime. It is not safely removable as-is.

The important finding: despite the name, it is not the main modern associatedPrimes package machinery. Its live job is powering maximal independent sets for monomial ideals.

Direct dependencies:

  • assprime.hpp defines AssociatedPrimes.
  • assprime.cpp implements AssociatedPrimes::associated_primes.
  • interface/monomial-ideal.cpp uses it in rawMaximalIndependentSets.
  • d/interface.dd exports that raw function.
  • m2/monideal.m2 exposes it as:
    independentSets MonomialIdeal := ... rawMaximalIndependentSets(...)

That independentSets method is used in real package code, notably PrimaryDecomposition, MinimalPrimes, NoetherNormalization, QuillenSuslin, and WhitneyStratifications.

There is also a second engine use in matrices/matrix.cpp, inside Matrix::dimension1(). That one looks dormant: I found the method definition and a header declaration, but no actual caller/binding.

The “newer/faster elsewhere” part seems to refer to monomial/monideal-minprimes.cpp, where MinimalPrimes now handles monomial codimension/minimal-prime paths. But it does not currently replace rawMaximalIndependentSets; max_indep_sets is declared in the header but not implemented in the .cpp.

So the removal path would be: first replace rawMaximalIndependentSets with a newer implementation, then remove/replace the dormant Matrix::dimension1() dependency, then drop assprime from CMakeLists.txt and Makefile.files.in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions