-
Notifications
You must be signed in to change notification settings - Fork 7
Comparison of AST for constraints #76
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Actually, the comparison of AST needs revision. This is important to identify redundancies (e.g., duplicate constraints with different ASTs), as well as to use 'hash' function over the AST.
A first try: to compare two AST, and therefore two constraints, first we need to pass the AST to CNF (already done), remove duplicate clauses, and sort the clauses by lenght and then by variables strings:
clauses = ast.get_clauses()
sorted_clauses = list(map(sorted, clauses))
sorted_clauses.sort(key=len)
Maybe there is another more correct way.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request