Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

PARI/GP formula generation now outputs multiple functions on separate lines, matching the existing LEAN formatter behavior.

Changes

  • src/form/pari.cpp: Modified PariFormula::toString() to detect multiple functions via FormulaUtil::getDefinitions() and format them with newline separators instead of semicolons
  • tests/formula/pari-function.txt: Updated test expectations for A000058 and A001715 to reflect multi-line output format

Example

Before:

(a(n) = b(n)+1); (b(n) = if(n==0,1,local(l1=b(n-1)); l1*(l1+1)))

After:

a(n) = b(n)+1
b(n) = if(n==0,1,local(l1=b(n-1)); l1*(l1+1))

Single-function formulas remain unchanged on a single line.

Original prompt

This section details on the original issue you should resolve

<issue_title>Multi-line PARI formulas</issue_title>
<issue_description>Similarly to the LEAN formula generation, it would be nice to split the generated formula code for PARI/GP into multiple lines if there are multiple functions.</issue_description>

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


💡 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.

Copilot AI and others added 3 commits November 5, 2025 20:08
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for multi-line PARI formula generation Support multi-line PARI formulas for multiple functions Nov 5, 2025
Copilot AI requested a review from ckrause November 5, 2025 20:13
Copilot finished work on behalf of ckrause November 5, 2025 20:13
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.

Multi-line PARI formulas

2 participants