Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic exception when proof-logging #116

Open
IgnaceBleukx opened this issue Nov 13, 2024 · 1 comment · Fixed by #115
Open

Panic exception when proof-logging #116

IgnaceBleukx opened this issue Nov 13, 2024 · 1 comment · Fixed by #115

Comments

@IgnaceBleukx
Copy link

Hi,

I'm using Pumpkin to generate a proof of an unsatisfiable jobshop model.
I got a some error triggered in the solver:

thread '<unnamed>' panicked at pumpkin-solver/src/engine/constraint_satisfaction_solver.rs:1567:17:
assertion failed: self.assignments_propositional.is_literal_assigned_true(premise)

The code below should generate a minimal-ish example (it's still quite elaborate...)

from pumpkin_py import Model
from pumpkin_py import constraints
import numpy as np

model = Model()

add  = model.add_constraint # shortcut
impl = model.add_implication # shortcut

s = np.array([[model.new_integer_variable(0,50,name=f"s_[{i},{j}]") for j in range(2)] for i in range(3)])
e = np.array([[model.new_integer_variable(0, 50,name=f"e_[{i},{j}]") for j in range(2)] for i in range(3)])

add(constraints.Cumulative(list(s[:,0]), [7, 1, 9], [1, 1, 1], 1))
add(constraints.BinaryEquals(s[0, 0].offset(7), e[0, 0]))
add(constraints.BinaryEquals(s[1, 0].offset(1), e[1, 0]))
add(constraints.BinaryEquals(s[2, 0].offset(9), e[2, 0]))

add(constraints.Cumulative(list(s[:,1]), [7, 5, 8], [1, 1, 1], 1))
add(constraints.BinaryEquals(s[0, 1].offset(7), e[0, 1]))
add(constraints.BinaryEquals(s[1, 1].offset(5), e[1, 1]))
add(constraints.BinaryEquals(s[2, 1].offset(8), e[2, 1]))

# precedence constraints
add(constraints.BinaryLessThanEqual(e[0,0], s[0,1]))
add(constraints.BinaryLessThanEqual(e[1, 0], s[1, 1]))
add(constraints.BinaryLessThanEqual(e[2, 0], s[2, 1]))
  
# encode maximum
max_var = model.new_integer_variable(0,50,name="max_var")
add(constraints.LessThanOrEquals([max_var], 24))

add(constraints.BinaryLessThanEqual(e[0, 0], max_var))
add(constraints.BinaryLessThanEqual(e[0, 1], max_var))
add(constraints.BinaryLessThanEqual(e[1, 0], max_var))
add(constraints.BinaryLessThanEqual(e[1, 1], max_var))
add(constraints.BinaryLessThanEqual(e[2, 0], max_var))
add(constraints.BinaryLessThanEqual(e[2, 1], max_var))

model.satisfy(proof="proof")

When disabling the proof-logging it works fine.

Currently running on the main branch (commit c1dd091)

@IgnaceBleukx IgnaceBleukx changed the title Panic Panic exception when proof-logging Nov 13, 2024
@maartenflippo
Copy link
Contributor

maartenflippo commented Nov 14, 2024

I think I fixed this now, try running on cd7a35b6edbf.

ImkoMarijnissen added a commit that referenced this issue Dec 4, 2024
TODOS

- [x] `compute_new` and all the others should be removed or refactored
- [x] There used to be an option for turning off clause-minimisation
- [x] TODOs in conflict analysis
- [x] Restore test cases in constraint satisfaction solver
- [x] Proof logging
- [x] Core extraction
- [x] `get_conflict_info` now clones but should not
- [x] Doc tests
- [x] Refactor `get_reason_simple`
- [x] Check python interface
- [x] Remove the backtracking method from conflict analysis context

Issues:
 - Closes #116
 - Closes #81
 - Closes #25
 - Closes #3

---------

Co-authored-by: Maarten Flippo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants