Commit a0fb111
feat: display Big O notation in CLI output (#263)
* feat: display Big O notation in CLI for complexity and overhead
Use asymptotic_normal_form to show simplified Big O notation alongside
exact formulas in `pred show` (variant complexity + reduction overhead)
and `pred path` (step overhead + composed overall). Also included in
JSON output as a `big_o` field.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: show only Big O notation, remove raw formulas, DRY helpers
Replace inline overhead display with shared big_o_of(), fmt_overhead_parts(),
and overhead_to_json() helpers. Display only asymptotic notation (no constant
factors) for complexity, reduction overhead, and path overhead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: always wrap Big O fallback in O(...) for consistent output
When asymptotic_normal_form fails (e.g., variable^variable like
num_vars^num_vars), the fallback now wraps the raw expression in O(...)
instead of displaying it bare. This ensures consistent format for both
human and JSON output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* normal form
* save
* feat: redesign asymptotic normal form into two-phase pipeline
Split the monolithic asymptotic_normal_form() into two explicit phases:
- canonical_form(): exact symbolic simplification with signed coefficients,
term merging, polynomial expansion, and transcendental identities
- big_o_normal_form(): asymptotic projection that drops dominated terms
and constant factors
Also adds:
- pred-sym CLI binary for debugging the symbolic engine
- Display Pow(x, 0.5) as sqrt(x) for cleaner output
- Variable^constant now supports fractional exponents in vars map
(enables n * n^0.5 → n^1.5 merging)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 52648df commit a0fb111
25 files changed
Lines changed: 3447 additions & 390 deletions
File tree
- docs
- agent-profiles
- plans
- problemreductions-cli
- src
- bin
- commands
- tests
- problemreductions-macros/src
- src
- rules
- unit_tests
- rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments