Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d9b25fb
Add symbolic growth domain (src/growth.rs) (#1075)
isPANN Jul 13, 2026
b198ddc
Rewire big_o_normal_form to the growth domain; delete canonical.rs (#…
isPANN Jul 13, 2026
b4f0753
Replace scalar Dijkstra with measured Pareto label-setting search (#1…
isPANN Jul 13, 2026
99fd008
Add instance-free asymptotic Pareto path search (GrowthLabel) + CLI/M…
isPANN Jul 13, 2026
8944ae8
Fix asymptotic Pareto front completeness: opt out of scalar B&B (#1080)
isPANN Jul 13, 2026
ad2c050
Dedup asymptotic front to one path per distinct growth vector (#1080)
isPANN Jul 13, 2026
015b1c6
Fix ILP i32->bool cast overhead: use size-field name num_vars, not ge…
isPANN Jul 13, 2026
106ca13
Silence expected reduction-probe panics in compute_source_size (#1076)
isPANN Jul 13, 2026
9849e4b
Add randomized property tests for growth domain (#1077)
isPANN Jul 13, 2026
8fd4fa8
Simplify growth/Pareto rendering and dominance (#1083)
isPANN Jul 13, 2026
a01caef
Rewire redundancy analysis to growth dominance (#1081)
isPANN Jul 13, 2026
d21822e
Give pred path --all real Big-O output (#1079)
isPANN Jul 13, 2026
b1a3d6e
Make pred path --all ordering deterministic via name+variant tiebreak…
isPANN Jul 13, 2026
66680dc
Simplify path_all sort: sort_by_cached_key (#1079)
isPANN Jul 13, 2026
5f4e9f2
Fix review blockers: growth classification, search soundness, CLI rou…
isPANN Jul 14, 2026
ba74bff
Simplify path enumeration to a single bounded-heap pass
isPANN Jul 14, 2026
daa61df
Delete branch-and-bound from the path-search kernel entirely
isPANN Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,11 @@ cli-demo: cli
$$PRED from QUBO --hops 1; \
\
echo ""; \
echo "--- 5. path: find reduction paths ---"; \
echo "--- 5. path: asymptotic Pareto front (no --size) ---"; \
$$PRED path MIS QUBO; \
$$PRED path MIS QUBO -o $(CLI_DEMO_DIR)/path_mis_qubo.json; \
$$PRED path Factoring SpinGlass; \
echo "--- 5b. path --cost: single concrete path (for reduce --via) ---"; \
$$PRED path MIS QUBO --cost minimize-steps -o $(CLI_DEMO_DIR)/path_mis_qubo.json; \
$$PRED path MIS QUBO --cost minimize:num_variables; \
\
echo ""; \
Expand Down
360 changes: 360 additions & 0 deletions docs/design/symbolic-growth-domain.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Show all paths or save for later use with `pred reduce --via`:
```bash
pred path MIS QUBO --all # all paths (up to 20)
pred path MIS QUBO --all --max-paths 50 # increase limit
pred path MIS QUBO -o path.json # save path for `pred reduce --via`
pred path MIS QUBO -o path.json # save front + best path for `pred reduce --via`
pred path MIS QUBO --all -o paths/ # save all paths to a folder
```

Expand Down
57 changes: 22 additions & 35 deletions problemreductions-cli/src/bin/pred_sym.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Parser, Subcommand};
use problemreductions::{big_o_normal_form, canonical_form, Expr, ProblemSize};
use problemreductions::{big_o_normal_form, Expr, ProblemSize};

#[derive(Parser)]
#[command(
Expand All @@ -19,11 +19,6 @@ enum Commands {
/// Expression string
expr: String,
},
/// Compute exact canonical form
Canon {
/// Expression string
expr: String,
},
/// Compute Big-O normal form
BigO {
/// Expression string
Expand All @@ -33,7 +28,7 @@ enum Commands {
#[arg(long)]
raw: bool,
},
/// Compare two expressions (exits with code 1 if neither exact nor Big-O equal)
/// Compare two expressions for Big-O equivalence (exits 1 if not equal)
Compare {
/// First expression
a: String,
Expand Down Expand Up @@ -69,16 +64,6 @@ fn main() {
let parsed = parse_expr_or_exit(&expr);
println!("{parsed}");
}
Commands::Canon { expr } => {
let parsed = parse_expr_or_exit(&expr);
match canonical_form(&parsed) {
Ok(result) => println!("{result}"),
Err(e) => {
eprintln!("Error: {e}");
std::process::exit(1);
}
}
}
Commands::BigO { expr, raw } => {
let parsed = parse_expr_or_exit(&expr);
match big_o_normal_form(&parsed) {
Expand All @@ -98,29 +83,31 @@ fn main() {
Commands::Compare { a, b } => {
let expr_a = parse_expr_or_exit(&a);
let expr_b = parse_expr_or_exit(&b);
let canon_a = canonical_form(&expr_a);
let canon_b = canonical_form(&expr_b);
let big_o_a = big_o_normal_form(&expr_a);
let big_o_b = big_o_normal_form(&expr_b);

println!("Expression A: {a}");
println!("Expression B: {b}");
let mut exact_equal = false;
let mut big_o_equal = false;
if let (Ok(ca), Ok(cb)) = (&canon_a, &canon_b) {
exact_equal = ca == cb;
println!("Canonical A: {ca}");
println!("Canonical B: {cb}");
println!("Exact equal: {exact_equal}");
}
if let (Ok(ba), Ok(bb)) = (&big_o_a, &big_o_b) {
big_o_equal = ba == bb;
println!("Big-O A: O({ba})");
println!("Big-O B: O({bb})");
println!("Big-O equal: {big_o_equal}");
}
if !exact_equal && !big_o_equal {
std::process::exit(1);
match (&big_o_a, &big_o_b) {
(Ok(ba), Ok(bb)) => {
// Rendering is canonical, so equal growth ⇒ equal Big-O expr.
let big_o_equal = ba == bb;
println!("Big-O A: O({ba})");
println!("Big-O B: O({bb})");
println!("Big-O equal: {big_o_equal}");
if !big_o_equal {
std::process::exit(1);
}
}
_ => {
if let Err(e) = &big_o_a {
println!("Big-O A: <unsupported: {e}>");
}
if let Err(e) = &big_o_b {
println!("Big-O B: <unsupported: {e}>");
}
std::process::exit(1);
}
}
}
Commands::Eval { expr, vars } => {
Expand Down
16 changes: 9 additions & 7 deletions problemreductions-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ Use `pred to <problem>` for incoming neighbors (what reduces to this).")]
/// Find the cheapest reduction path between two problems
#[command(after_help = "\
Examples:
pred path MIS QUBO # cheapest path
pred path MIS QUBO # asymptotic Pareto front (Big-O per size field)
pred path MIS QUBO --all # all paths
pred path MIS QUBO -o path.json # save for `pred reduce --via`
pred path MIS QUBO -o path.json # save front + best path for `pred reduce --via`
pred path MIS QUBO --all -o paths/ # save all paths to a folder
pred path MIS QUBO --cost minimize:num_variables
pred path MIS QUBO --cost minimize:num_variables # single cheapest path by a scalar cost (also -o for --via)

Use `pred list` to see available problems.")]
Path {
Expand All @@ -126,9 +126,10 @@ Use `pred list` to see available problems.")]
/// Target problem (e.g., QUBO)
#[arg(value_parser = crate::problem_name::ProblemNameParser)]
target: String,
/// Cost function [default: minimize-steps]
#[arg(long, default_value = "minimize-steps")]
cost: String,
/// Scalar cost function ('minimize-steps' or 'minimize:<field>') for a single
/// best path. Omit to get the instance-free asymptotic Pareto front.
#[arg(long)]
cost: Option<String>,
/// Show all paths instead of just the cheapest
#[arg(long)]
all: bool,
Expand Down Expand Up @@ -1273,7 +1274,8 @@ Examples:
pred create MIS --graph 0-1,1-2 | pred reduce - --to QUBO # read from stdin

Input: a problem JSON from `pred create`. Use - to read from stdin.
The --via path file is from `pred path <SRC> <DST> -o path.json`.
The --via path file is from `pred path <SRC> <DST> -o path.json` (its
top-level `path` is the best path; add --cost to pick a scalar-optimal one).
When --via is given, --to is inferred from the path file.
Output is a reduction bundle with source, target, and path.
Use `pred solve reduced.json` to solve and map the solution back.")]
Expand Down
Loading
Loading