6 Commits

Author SHA1 Message Date
NoName11234
0d46b77e9f fixed matrixk2 test 2024-05-23 18:23:32 +02:00
NoName11234
2ef5131ae6 fixed missing oderConstraints 2024-05-23 10:44:03 +02:00
NoName11234
fffad5693a small fixes for scalark3 test 2024-05-23 09:43:21 +02:00
NoName11234
cf3a9afed7 implemented scalark3 test 2024-05-23 09:33:10 +02:00
NoName11234
2fdebc0203 implemented scalark2test 2024-05-15 17:17:58 +02:00
NoName11234
cf8653567c changed arraylist to concurrent set and removed snychronized 2024-04-25 19:17:12 +02:00
2 changed files with 2026 additions and 7 deletions

View File

@@ -1,13 +1,10 @@
package de.dhbwstuttgart.typeinference.unify.model;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import de.dhbwstuttgart.typeinference.unify.distributeVariance;
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
@@ -23,7 +20,7 @@ public final class PlaceholderType extends UnifyType{
* Static list containing the names of all existing placeholders.
* Used for generating fresh placeholders.
*/
public static final ArrayList<String> EXISTING_PLACEHOLDERS = new ArrayList<String>();
public static final Set<String> EXISTING_PLACEHOLDERS = ConcurrentHashMap.newKeySet();
/**
* Prefix of auto-generated placeholder names.
@@ -96,7 +93,7 @@ public final class PlaceholderType extends UnifyType{
* A user could later instantiate a type using the same name that is equivalent to this type.
* @return A fresh placeholder type.
*/
public synchronized static PlaceholderType freshPlaceholder() {
public static PlaceholderType freshPlaceholder() {
String name = nextName + (char) (rnd.nextInt(22) + 97); // Returns random char between 'a' and 'z'
// Add random chars while the name is in use.
while(EXISTING_PLACEHOLDERS.contains(name)) {

File diff suppressed because it is too large Load Diff