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

Run multiple file .cnf.txt then export to a file? #35

Closed
anhpham197 opened this issue Mar 31, 2023 · 9 comments
Closed

Run multiple file .cnf.txt then export to a file? #35

anhpham197 opened this issue Mar 31, 2023 · 9 comments

Comments

@anhpham197
Copy link

Is there any way to run multiple files .cnf.txt (in build folder) and export the result to a file instead of running each file in turn and then reading the results in the console?
Thanks!

@arminbiere
Copy link
Owner

I am not sure what you are after. A simple shell script could do that.

@anhpham197
Copy link
Author

anhpham197 commented Mar 31, 2023

I wanna run multiple files cnf at once time, then I can export the result to a file.

@arminbiere
Copy link
Owner

arminbiere commented Mar 31, 2023

Yes, this is exactly what simple shell scripting would be able to do.
I give two options for solving the 'sqrt...' CNFs in 'test/cnf'.

  1. If you want to run kissat on all the CNFs separately but concat the output:
$ ls test/cnf/sqrt*.cnf|xargs -n 1 kissat

You can do this even say for 8 cores in parallel by adding -P 8 after -n 1.

  1. If on the other hand you want concatenate the CNFs, just filter out the clauses,
    add a dummy header before and tell Kissat to use relaxed parsing:
$ (echo 'p cnf 0 0'; sed -e '/^[chp]/d' test/cnf/sqrt*.cnf)|kissat --relaxed

@anhpham197
Copy link
Author

Thanks a ton, @arminbiere . It's exactly what I want. Do you plan to implement Kissat on Windows?

@arminbiere
Copy link
Owner

There are ports by others (see also issue #33) and yes I also plan to have ports at one point in the main repro but probably not provide binaries.

@anhpham197
Copy link
Author

Hope to see your addition soon. Have a nice weekend, @arminbiere

@DvonHolten
Copy link

well, the reasons against windows exe-files can be understood.
OTOH, it can be a PITA to setup a c compiler chain just to get some executable. Some people are just interested in running the SAT-solver as a black box. Some projects use makefile, others use cmake.

@anhpham197
Copy link
Author

Cuz I'm using Sat4j library supporting Windows, then I've tested some problems by Kissat and found that Kissat is extremely good in terms of both solving time and the number of problems solved. Hence, I wanna find another version of Kissat on Windows to test.

@gsgs2
Copy link

gsgs2 commented Aug 19, 2023

I agree that this would be useful. I.e. for benchmark-sets.

I'm copying all the files into one file,
I wrote a program to read that big file
and extract one instance after the other,
to file kk
then call
system(" ./kissat -q kk >> ll");
and postprocess ll

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

4 participants