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

[Enhancement Proposal] Only one type of problem for Solve, Explain and MaxSAT #25

Open
Mystelven opened this issue Jun 26, 2020 · 1 comment

Comments

@Mystelven
Copy link
Contributor

Mystelven commented Jun 26, 2020

You have three structures Problem one in the packageexplain, one in the package maxsat and one in the package solver.

However, It seems that it could be convenient to first solve a problem and if the result is unsatisfiable, then find an explanation (MUS or just an unsatisfiable subset).

A simple (but inefficient) way is to do it as follows:

func Convert(problem *solver.Problem) (*explain.Problem, error) {

	reader := strings.NewReader(problem.CNF())
	return explain.ParseCNF(reader)
}

But having only one type of structure for both packages seems more convenient in my opinion.
Same principle with the problem structure for MaxSAT problem.

If you accept this "improvement", I will propose a PR for it.

Keep me informed @fdelorme

@Mystelven Mystelven changed the title [Enhancement Proposal] [Enhancement Proposal] Only one type of problem for Solve, Explain and MaxSAT Jun 26, 2020
@fdelorme
Copy link
Member

That's a very good idea! That kind of thing was on my TODO-list anyway.

There's one potential pitfal you must be aware: in the solver package, problems are simplified as soon as they are parsed (meaning the problem (a or b or c) and not a will be transmitted as b or c to the solver).

That's not something you want when searching for MUSes or for MAXSAT problems though, so there are probably a few things to modify here and there in the solver package.

I'm looking forward to seeing your PR!

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

No branches or pull requests

2 participants