Skip to content

Commit a0fb111

Browse files
GiggleLiuclaude
andauthored
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,4 @@ claude-output.log
8686
*.json
8787
.claude/worktrees/
8888
docs/test-reports/
89+
docs/superpowers/

docs/agent-profiles/FEATURES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Features
2+
3+
- [Library API] — Define NP-hard problems, evaluate configurations, and reduce between problem types using Rust traits
4+
- [CLI Tool (pred)] — Explore the reduction graph, create/inspect/reduce/solve problem instances from the terminal
5+
- [MCP Server] — AI assistant integration via Model Context Protocol for graph queries and problem manipulation
6+
- [Reduction Graph] — Automatic shortest-path search through registered reductions between problem types
7+
- [BruteForce Solver] — Enumerate all configurations to find optimal or satisfying solutions
8+
- [Variant System] — Graph/weight type parameterization with compile-time complexity registration
9+
- [Overhead System] — Symbolic expressions describing how target problem size relates to source after reduction
10+
- [Serialization] — JSON schema export and serde-based serialization for all problem types

docs/agent-profiles/SKILLS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Skills
2+
3+
- [issue-to-pr] — Convert a GitHub issue into a PR with an implementation plan
4+
- [add-model] — Add a new problem model to the codebase
5+
- [add-rule] — Add a new reduction rule to the codebase
6+
- [review-implementation] — Review implementation completeness via parallel subagents
7+
- [fix-pr] — Resolve PR review comments, CI failures, and coverage gaps
8+
- [check-issue] — Quality gate for Rule and Model GitHub issues
9+
- [check-rule-redundancy] — Check if a reduction rule is redundant via composite paths
10+
- [write-model-in-paper] — Write or improve a problem-def entry in the Typst paper
11+
- [write-rule-in-paper] — Write or improve a reduction-rule entry in the Typst paper
12+
- [release] — Create a new crate release with version bump
13+
- [meta-power] — Batch-resolve all open Model and Rule issues autonomously
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# cli-tool-dr-sarah-chen
2+
3+
## Target
4+
CLI Tool (pred)
5+
6+
## Use Case
7+
End-to-end workflow: create an MIS instance, reduce it to QUBO, solve the QUBO, and verify the mapped-back solution matches the known optimum.
8+
9+
## Expected Outcome
10+
The full create → reduce → solve → evaluate pipeline completes successfully with correct optimal results. JSON output is well-formed and machine-readable at every stage.
11+
12+
## Agent
13+
14+
### Background
15+
Dr. Sarah Chen is a computational physicist at a national lab who regularly uses optimization solvers (Gurobi, CPLEX, HiGHS) in her research on quantum annealing benchmarks. She evaluates new tools by running them against problems with known optimal solutions.
16+
17+
### Experience Level
18+
Expert
19+
20+
### Decision Tendencies
21+
Tests edge cases proactively — tries empty graphs, disconnected components, and large instances. Expects precise, actionable error messages when things go wrong. Compares solver output against independently computed optima. Will read --help but also try undocumented flag combinations.
22+
23+
### Quirks
24+
Will try both file-based and piped workflows to check consistency. Inspects JSON output with jq for machine-readability. Gets impatient with vague error messages like "invalid input" — wants to know exactly what's wrong and where.

0 commit comments

Comments
 (0)