Formula will be generated using following arguments:
-n : Number of non-empty clauses that should occur in a formula
-k : Maximum number of variables that can occur in a formula
-l : Maximum size of each clause
--strict: Every clause should have l literals (optional)
Instructions to generate CNF formula
-
Go to the folder where the groovy file RandomFormulaGenerator.groovy is.
-
Enter following command in CLI.
groovy RandomFormulaGenerator.groovy -n N -k K -l L --strict
- You will get a file with .cnf extension in the same folder of your program.
Note: Enter your constraint parameters in place of N, K and L by following definitions given above for each option. --strict option is not necessary to generate CNF formula. By specifying --strict, every clause contained in a generated formula will be having L literals.
---Aditya Narkar---