-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compile errors due to last #239 commit
- Loading branch information
1 parent
66cc184
commit e7c4d7c
Showing
5 changed files
with
166 additions
and
28 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...burg/informatik/ultimate/modelcheckerutils/absint/vpdomain/CongruenceClosureSmtUtils.java
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,39 @@ | ||
package de.uni_freiburg.informatik.ultimate.modelcheckerutils.absint.vpdomain; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import de.uni_freiburg.informatik.ultimate.logic.Script; | ||
import de.uni_freiburg.informatik.ultimate.logic.Term; | ||
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.smt.SmtUtils; | ||
import de.uni_freiburg.informatik.ultimate.util.datastructures.CongruenceClosure; | ||
|
||
public class CongruenceClosureSmtUtils { | ||
public static <NODE extends IEqNodeIdentifier<NODE>> Term congruenceClosureToTerm(final Script script, | ||
final CongruenceClosure<NODE> pa) { | ||
return SmtUtils.and(script, congruenceClosureToCube(script, pa)); | ||
} | ||
|
||
public static <NODE extends IEqNodeIdentifier<NODE>> List<Term> congruenceClosureToCube(final Script script, | ||
// public static <NODE extends ICongruenceClosureElement<NODE>> List<Term> congruenceClosureToCube(final Script script, | ||
final CongruenceClosure<NODE> pa) { | ||
if (pa.isInconsistent()) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
final List<Term> elementEqualities = pa.getSupportingElementEqualities().entrySet().stream() | ||
.map(en -> script.term("=", en.getKey().getTerm(), en.getValue().getTerm())) | ||
.collect(Collectors.toList()); | ||
final List<Term> elementDisequalities = pa.getElementDisequalities().entrySet().stream() | ||
.map(pair -> script.term("distinct", pair.getKey().getTerm(), pair.getValue().getTerm())) | ||
.collect(Collectors.toList()); | ||
|
||
final List<Term> result = new ArrayList<>(elementEqualities.size() + elementDisequalities.size()); | ||
result.addAll(elementEqualities); | ||
result.addAll(elementDisequalities); | ||
return result; | ||
} | ||
|
||
} |
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
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