-
Notifications
You must be signed in to change notification settings - Fork 16
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
pull request for Sat backend #415
Draft
Shikhar-Srivastava-16
wants to merge
34
commits into
conjure-cp:main
Choose a base branch
from
Shikhar-Srivastava-16:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
136d488
basic framework
Shikhar-Srivastava-16 b44b2fb
added basic functions
Shikhar-Srivastava-16 5e03ea5
refactored into separate module
Shikhar-Srivastava-16 fd58cbf
basic functions for populating SatInstance
Shikhar-Srivastava-16 1d02783
removed kissat lib, not in use
Shikhar-Srivastava-16 a764a25
changes to Cargo.toml
Shikhar-Srivastava-16 ac6b5c4
changes to building cargo.lock, auto-gen
Shikhar-Srivastava-16 0c662cc
added solver_instance with trait for solver and updated library script
Shikhar-Srivastava-16 ae9bc3b
removed unused file
Shikhar-Srivastava-16 5f39b3b
basic structure for solver adaptor, may not function well
Shikhar-Srivastava-16 faada12
more basics, see before
Shikhar-Srivastava-16 42beb47
push for adaptor
1e34041
Updated the lib.rs and added solver_utils to it
261dd47
Updated main.rs to display the solver result
5fcd6b6
Updated main.rs to display the solver result
5194683
Updated all sat_rs files by implementing a solver and mapping
9c6397f
minor change to main.rs, temp
d949cdf
Merge branch 'main' of https://github.com/Shikhar-Srivastava-16/conju…
e29dcaf
debugging
ea2ce69
changes
615c76f
final functions for model generation (must integrate into load)
80e780f
removed kissat.rs file, made relevant changes to other files
6659fdd
function in `SolverAdaptor` trait called, partial implementation for …
b139de3
housekeeping
d806a7e
Implemented the solver and edited the coversion functions as well
f62e008
Making changes
b01b714
housekeeping
b222638
adaptor changes
55d0458
Fixed bugs and implemeneted a solver
c2b2d32
rename + auxiliary file deleted
Shikhar-Srivastava-16 731921b
rename, unneeded main deleted
Shikhar-Srivastava-16 25162e2
rename WIP
Shikhar-Srivastava-16 c9ca602
tests added
Shikhar-Srivastava-16 f20119f
Cleaned up some code and removed coments from files I have worked on
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shikhar-Srivastava-16 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use crate::solver::SolverFamily; | ||
|
||
use rustsat::instances::SatInstance; | ||
|
||
use sat_rs::{sat_solvers::SatSolverInst, sat_tree}; | ||
|
||
// use rustsat_minisat: | ||
|
||
trait SolverAdaptor { | ||
fn prep_dat(); | ||
|
||
fn get_soln(); | ||
|
||
fn print_soln() -> (); | ||
} | ||
|
||
impl SolverAdaptor for SatSolverInst<SolverType: > { | ||
fn prep_dat(vec_problem: &Vec<Vec<i16>>, inst_in_use: &mut SatInstance) -> () { | ||
// todo!() | ||
sat_tree::conv_to_formula(&vec_problem, &mut self.inst); | ||
} | ||
|
||
fn get_soln() -> Result<bool, String>{ | ||
// todo!() | ||
self.solver.solve() | ||
} | ||
|
||
fn print_soln() { | ||
// todo!() | ||
match problem.solve() { | ||
Ok(true) => { | ||
println!("SATISFIABLE"); | ||
println!("a = {}", problem.get_assignment(a).unwrap()); | ||
println!("b = {}", problem.get_assignment(b).unwrap()); | ||
} | ||
Ok(false) => println!("UNSATISFIABLE"), | ||
Err(e) => println!("Error during solving: {:?}", e), | ||
} | ||
} | ||
|
||
|
||
} | ||
|
||
struct MinionAdaptor { | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
//! Solver adaptors. | ||
|
||
#[doc(inline)] | ||
pub use kissat::Kissat; | ||
// #[doc(inline)] | ||
// pub use kissat::Kissat; | ||
#[doc(inline)] | ||
pub use minion::Minion; | ||
pub use sat_adaptor::SAT; | ||
// mod sat_common; | ||
|
||
mod sat_common; | ||
|
||
mod kissat; | ||
// mod kissat; | ||
mod minion; | ||
pub mod sat_adaptor; //temp visibility | ||
// mod common; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we decided to remove the sat_rs crate, is it still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still being used for some of the model loading step, so retaining it.