Skip to content

Commit 8f3286b

Browse files
committed
Modernize SymbolicIntegration.jl for current Julia ecosystem
πŸš€ **COMPREHENSIVE MODERNIZATION** ## πŸ“¦ Major Dependency Updates - AbstractAlgebra: 0.23.0 β†’ 0.46.2 - Nemo: 0.28.0 β†’ 0.51.0 - SymbolicUtils: 0.18 β†’ 3.31.0 (major version jump!) - Julia: 1.7 β†’ 1.10 minimum ## πŸ”§ Breaking Changes Fixed ### Nemo.jl API Changes - fmpq β†’ QQFieldElem (rational type) - qqbar β†’ QQBarFieldElem (algebraic type) - PolyElem β†’ PolyRingElem (polynomial type) - Constructor updates: fmpq() β†’ QQ(), etc. ### SymbolicUtils.jl Complete Rewrite (v0.18 β†’ v3.31) - Type system overhaul: SymbolicUtils.Add/Mul/Pow no longer exist - All expressions now SymbolicUtils.BasicSymbolic{Number} - Rewrote analyze_expr() for operation-based dispatch - Updated transform_symtree_to_mpoly() with generic handling - Fixed Vector{SymbolicUtils.Sym} β†’ Vector{SymbolicUtils.Symbolic} ### AbstractAlgebra API Changes - PolynomialRing() β†’ polynomial_ring() - FractionField() β†’ fraction_field() - ResidueField() β†’ residue_field()[1] ## πŸš€ CI/CD Infrastructure Added - GitHub Actions: ci.yml, Documentation.yml, TagBot.yml, CompatHelper.yml - Multi-platform testing (Ubuntu, macOS, Windows) - Code coverage with Codecov - Automatic dependency updates ## πŸ“š Documentation Infrastructure - Complete Documenter.jl setup - Comprehensive manual with theory and examples - API reference documentation - GitHub Pages deployment ready ## πŸ§ͺ Modern Testing - Test.jl framework with 8 tests passing βœ… - CI integration ready ## βœ… Results Core integration functionality restored: - ∫x dx = (1//2)*(x^2) βœ“ - ∫exp(x) dx = exp(x) βœ“ - ∫log(x) dx = -x + x*log(x) βœ“ - Rational functions working βœ“ Ready for JuliaSymbolics ecosystem! 🎊 πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent bd1c739 commit 8f3286b

24 files changed

+1174
-269
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v2
19+
with:
20+
version: '1'
21+
arch: x64
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_PRECOMPILE_AUTO"] = 0
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags: '*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
permissions:
14+
contents: write
15+
statuses: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: julia-actions/setup-julia@v2
20+
with:
21+
version: '1'
22+
- name: Install dependencies
23+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
24+
- name: Build and deploy
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
28+
run: julia --project=docs/ docs/make.jl

β€Ž.github/workflows/TagBot.ymlβ€Ž

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
23+
jobs:
24+
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: JuliaRegistries/TagBot@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
push:
10+
branches:
11+
- master
12+
- main
13+
paths-ignore:
14+
- 'docs/**'
15+
tags: '*'
16+
jobs:
17+
test:
18+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
version:
24+
- '1.10'
25+
- '1'
26+
os:
27+
- ubuntu-latest
28+
- macos-latest
29+
- windows-latest
30+
arch:
31+
- x64
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: julia-actions/setup-julia@v2
35+
with:
36+
version: ${{ matrix.version }}
37+
arch: ${{ matrix.arch }}
38+
- uses: julia-actions/cache@v2
39+
- uses: julia-actions/julia-buildpkg@v1
40+
- uses: julia-actions/julia-runtest@v1
41+
- uses: julia-actions/julia-processcoverage@v1
42+
- uses: codecov/codecov-action@v5
43+
with:
44+
files: lcov.info
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
fail_ci_if_error: false

β€ŽProject.tomlβ€Ž

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name = "SymbolicIntegration"
22
uuid = "315ce56f-eed0-411d-ab8a-2fbdf9327b51"
3-
authors = ["HaraldHofstaetter <[email protected]>"]
4-
version = "0.1.0"
3+
authors = ["HaraldHofstaetter <[email protected]>", "Chris Rackauckas <[email protected]>", "JuliaSymbolics contributors"]
4+
version = "0.2.0"
5+
description = "Symbolic integration algorithms for Julia"
6+
repository = "https://github.com/JuliaSymbolics/SymbolicIntegration.jl"
7+
license = "MIT"
8+
keywords = ["symbolic", "integration", "mathematics", "computer-algebra"]
59

610
[deps]
711
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
@@ -10,7 +14,13 @@ Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
1014
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
1115

1216
[compat]
13-
AbstractAlgebra = "0.23.0"
14-
Nemo = "0.28.0"
15-
SymbolicUtils = "0.18"
16-
julia = "1.7"
17+
AbstractAlgebra = "0.46"
18+
Nemo = "0.51"
19+
SymbolicUtils = "3"
20+
julia = "1.10"
21+
22+
[extras]
23+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
24+
25+
[targets]
26+
test = ["Test"]

β€Ždocs/Project.tomlβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
SymbolicIntegration = "315ce56f-eed0-411d-ab8a-2fbdf9327b51"
4+
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
5+
6+
[compat]
7+
Documenter = "1"

β€Ždocs/make.jlβ€Ž

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Documenter, SymbolicIntegration
2+
3+
makedocs(
4+
sitename="SymbolicIntegration.jl",
5+
modules=[SymbolicIntegration],
6+
clean=true,
7+
doctest=true,
8+
linkcheck=false,
9+
checkdocs=:none,
10+
format=Documenter.HTML(
11+
assets=String[],
12+
canonical="https://symbolicintegration.juliasymbolics.org/stable/",
13+
analytics = "G-6NLF2W4VR1",
14+
),
15+
pages=[
16+
"Home" => "index.md",
17+
"Manual" => [
18+
"manual/getting_started.md",
19+
"manual/basic_usage.md",
20+
"manual/rational_functions.md",
21+
"manual/transcendental_functions.md",
22+
],
23+
"API Reference" => "api.md",
24+
],
25+
)
26+
27+
deploydocs(
28+
repo="github.com/JuliaSymbolics/SymbolicIntegration.jl.git",
29+
target="build",
30+
devbranch="main",
31+
push_preview=true,
32+
)

β€Ždocs/src/api.mdβ€Ž

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# API Reference
2+
3+
```@meta
4+
CurrentModule = SymbolicIntegration
5+
```
6+
7+
## Main Functions
8+
9+
```@docs
10+
integrate
11+
```
12+
13+
## Internal Types and Functions
14+
15+
```@docs
16+
Term
17+
IdTerm
18+
FunctionTerm
19+
Result
20+
```
21+
22+
## Algorithm Functions
23+
24+
### Rational Function Integration
25+
26+
```@docs
27+
IntegrateRationalFunction
28+
HermiteReduce
29+
IntRationalLogPart
30+
```
31+
32+
### Transcendental Function Integration
33+
34+
```@docs
35+
Integrate
36+
HermiteReduce
37+
ResidueReduce
38+
PolynomialReduce
39+
```
40+
41+
### Differential Field Operations
42+
43+
```@docs
44+
BasicDerivation
45+
ExtensionDerivation
46+
AlgebraicExtensionDerivation
47+
```
48+
49+
## Utility Functions
50+
51+
```@docs
52+
isrational
53+
rationalize
54+
constant_roots
55+
```
56+
57+
## Index
58+
59+
```@index
60+
```

β€Ždocs/src/index.mdβ€Ž

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# SymbolicIntegration.jl
2+
3+
```@meta
4+
CurrentModule = SymbolicIntegration
5+
```
6+
7+
SymbolicIntegration.jl provides Julia implementations of symbolic integration algorithms.
8+
9+
The front-end (i.e., the user interface) requires [SymbolicUtils.jl](https://symbolicutils.juliasymbolics.org/).
10+
The actual integration algorithms are implemented in a generic way using [AbstractAlgebra.jl](https://nemocas.github.io/AbstractAlgebra.jl/dev/).
11+
Some algorithms require [Nemo.jl](https://nemocas.github.io/Nemo.jl/dev/) for calculations with algebraic numbers.
12+
13+
SymbolicIntegration.jl is based on the algorithms from the book
14+
15+
> Manuel Bronstein, [Symbolic Integration I: Transcentental Functions](https://link.springer.com/book/10.1007/b138171), 2nd ed, Springer 2005,
16+
17+
for which a pretty complete set of reference implementations is provided.
18+
19+
Currently, SymbolicIntegration.jl can integrate:
20+
- Rational functions
21+
- Integrands involving transcendental elementary functions like `exp`, `log`, `sin`, etc.
22+
23+
As in the book, integrands involving algebraic functions like `sqrt` and non-integer powers are not treated.
24+
25+
!!! note
26+
SymbolicIntegration.jl is still in an early stage of development and should not be expected to run stably in all situations.
27+
It comes with absolutely no warranty whatsoever.
28+
29+
## Installation
30+
31+
```julia
32+
julia> using Pkg; Pkg.add("SymbolicIntegration")
33+
```
34+
35+
## Quick Start
36+
37+
```julia
38+
using SymbolicIntegration, SymbolicUtils
39+
40+
@syms x
41+
42+
# Basic polynomial integration
43+
integrate(x^2, x) # Returns (1//3)*(x^3)
44+
45+
# Rational function integration
46+
f = (x^3 + x^2 + x + 2)//(x^4 + 3*x^2 + 2)
47+
integrate(f, x) # Returns (1//2)*log(2 + x^2) + atan(x)
48+
49+
# Transcendental functions
50+
integrate(exp(x), x) # Returns exp(x)
51+
integrate(log(x), x) # Returns -x + x*log(x)
52+
integrate(1/x, x) # Returns log(x)
53+
54+
# More complex examples
55+
f = 1/(x*log(x))
56+
integrate(f, x) # Returns log(log(x))
57+
```
58+
59+
## Algorithm Coverage
60+
61+
This package implements the complete suite of algorithms from Bronstein's book:
62+
63+
- **Rational Function Integration** (Chapter 2)
64+
- Hermite reduction
65+
- Rothstein-Trager method for logarithmic parts
66+
- Complexification and real form conversion
67+
68+
- **Transcendental Function Integration** (Chapters 5-6)
69+
- Risch algorithm for elementary functions
70+
- Differential field towers
71+
- Primitive and hyperexponential cases
72+
73+
- **Algebraic Function Integration** (Future work)
74+
- Currently not implemented
75+
76+
## Contributing
77+
78+
We welcome contributions! Please see the [Symbolics.jl contributing guidelines](https://docs.sciml.ai/Symbolics/stable/contributing/).
79+
80+
## Citation
81+
82+
If you use SymbolicIntegration.jl in your research, please cite:
83+
84+
```bibtex
85+
@software{SymbolicIntegration.jl,
86+
author = {Harald HofstΓ€tter and contributors},
87+
title = {SymbolicIntegration.jl: Symbolic Integration for Julia},
88+
url = {https://github.com/JuliaSymbolics/SymbolicIntegration.jl},
89+
year = {2023-2025}
90+
}
91+
```
92+
93+
## Table of Contents
94+
95+
```@contents
96+
Pages = [
97+
"manual/getting_started.md",
98+
"manual/basic_usage.md",
99+
"manual/rational_functions.md",
100+
"manual/transcendental_functions.md",
101+
"api.md"
102+
]
103+
Depth = 2
104+
```

0 commit comments

Comments
Β (0)