Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

  • Add has_pari and has_lean UIDSets to Stats class in stats.hpp
  • Update PROGRAMS_HEADER to include "pari" and "lean" columns after "formula"
  • Modify updateProgramStats() to parse formulas and attempt PARI/LEAN conversions
  • Update save() method to write pari and lean columns to CSV
  • Update load() method to read pari and lean columns from CSV
  • Build and test the changes
  • Test with actual program data to verify conversions work
  • Pass offset parameter to conversion functions

Summary

Successfully implemented the "pari" and "lean" columns in program stats. The implementation:

  1. Added two new UIDSets (has_pari and has_lean) to track which programs have formulas that can be converted to PARI and LEAN
  2. Modified the CSV header to include "pari" and "lean" columns after "formula"
  3. Updated updateProgramStats() to:
    • Accept both formula string and offset as parameters
    • Parse formula strings and attempt conversions using PariFormula::convert() and LeanFormula::convert()
    • Pass the offset value to the conversion functions (important for conversion decisions)
  4. Updated both save() and load() methods to handle the new columns
  5. Modified call site in mine_manager.cpp to extract offset using ProgramUtil::getOffset() and pass it along with the formula string

The offset parameter is crucial as it can influence whether a formula can be successfully converted to PARI or LEAN format.

All existing tests pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add "pari" and "lean" columns to program stats</issue_title>
<issue_description>Add two new columns to the program stats: "pari" and "lean". They should be added after the "formula" column. They are both bools. If a program has a formula, parse it and try converting it to PARI and LEAN. Set the columns to 1 if the respective conversion was successful.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #543


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Copilot AI changed the title [WIP] Add pari and lean columns to program stats Add "pari" and "lean" columns to program stats Oct 19, 2025
Copilot AI requested a review from ckrause October 19, 2025 04:32
Copilot finished work on behalf of ckrause October 19, 2025 04:32
Copy link
Contributor

@ckrause ckrause left a comment

Choose a reason for hiding this comment

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

@copilot Please check my comments.

Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Copilot AI requested a review from ckrause October 19, 2025 04:53
Copilot finished work on behalf of ckrause October 19, 2025 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants