-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix brute force + lots of changes + create new api + idk
- Loading branch information
Showing
6 changed files
with
305 additions
and
138 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import api | ||
|
||
args = api.read_args("""============================ | ||
--- BruteForce SatSolver --- | ||
Solve a CNF SAT equation with 'Disjunctive Absorption' | ||
Usage: %c -- 'Equation' [OPTIONS] | ||
%{grammar} | ||
Options: | ||
-o Output File (Will Write if Specified) | ||
-c Write Output to Console | ||
============================""") | ||
|
||
EQUATION = args['eq'] | ||
|
||
def trivial(): | ||
pass | ||
|
||
print() | ||
|
||
for i in range(0, api.varcount(EQUATION)): | ||
print(i, api.occurences(EQUATION, i)) | ||
|
||
# SOLUTIONS = api.solve_equation(args['eq']) | ||
|
||
# SOLUTIONS = [] | ||
|
||
# def solve(EQC, verify, mode): | ||
# if isinstance(EQC, int): | ||
# return EQC * verify[abs(EQC) - 1] > 0 | ||
|
||
# return mode([solve(clause, verify, any) for clause in EQC]) | ||
|
||
# for verify in itertools.product((-1, +1), repeat=args['eq-variables']): | ||
# if solve(args['eq'], verify, all): | ||
# SOLUTIONS.append(' '.join([str((idx + 1) * x) for idx, x in enumerate(verify)])) | ||
|
||
# print(f'The equation has {len(SOLUTIONS)} solutions.') | ||
# if 'c' in args['flags']: | ||
# print('\n'.join(map(lambda x: str(x) ,SOLUTIONS))) |
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
Oops, something went wrong.