Skip to content

times constraint with unbounded variables panic with: attempt to subtract with overflow #368

Description

@pellico

Pumpkin version 0.3.0
code

use std::{i32, result, vec};

use pumpkin_solver::conflict_resolvers::resolvers::ResolutionResolver;
use pumpkin_solver::core::results::{ProblemSolution, SatisfactionResult};
use pumpkin_solver::core::termination::Indefinite;
use pumpkin_solver::*;
fn main() {
    let mut solver = Solver::default();

    // We create 3 variables
    let x = solver.new_bounded_integer(i32::MIN, i32::MAX);
    let y = solver.new_bounded_integer(i32::MIN, i32::MAX);
    let z = solver.new_bounded_integer(i32::MIN, i32::MAX);
    let c1 = solver.new_constraint_tag();
    solver.add_constraint(times(x, y, z, c1)).post().unwrap();

    let mut termination = Indefinite;
    let mut resolver = ResolutionResolver::default();
    let mut brancher = solver.default_brancher();
    let result = solver.satisfy(&mut brancher, &mut termination, &mut resolver);

   
}

This panic with message:

attempt to subtract with overflow

Activity

  1. changed the title [-]times constraint with unbounded variables panic with: `attempt to subtract with overflow`[/-] [+]`times` constraint with unbounded variables panic with: `attempt to subtract with overflow`[/+] on Feb 11, 2026
  2. added theissue type on Mar 17, 2026
  3. added
    bug
    on Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions