use of abs.frontend.typechecker.locationtypes.LocationTypeExtension in project abstools by abstools.
the class LocationTypeTests method testInferenceRetypeChecking.
@Test
public void testInferenceRetypeChecking() {
String code = "interface I { Unit m(); } { [Far] I i; I j; i = j; j.m(); }";
Model m = assertParseOkStdLib(code);
LocationTypeExtension te = new LocationTypeExtension(m);
m.registerTypeSystemExtension(te);
SemanticConditionList e = m.typeCheck();
m.typeCheck(new SemanticConditionList());
}
use of abs.frontend.typechecker.locationtypes.LocationTypeExtension in project abstools by abstools.
the class LocationTypeTests method assertLocationTypeErrorOnly.
private void assertLocationTypeErrorOnly(String code) {
Model m = assertParse(code, WITH_STD_LIB);
LocationTypeExtension te = new LocationTypeExtension(m);
m.registerTypeSystemExtension(te);
SemanticConditionList e = m.typeCheck();
assertFalse("No type error occurred", !e.containsErrors());
assertInferFails(code);
}
use of abs.frontend.typechecker.locationtypes.LocationTypeExtension in project abstools by abstools.
the class LocationTypeTests method assertTypeOkOnly.
private void assertTypeOkOnly(String code) {
Model m = assertParse(code, WITH_STD_LIB);
LocationTypeExtension te = new LocationTypeExtension(m);
m.registerTypeSystemExtension(te);
m.getErrors();
SemanticConditionList e = m.typeCheck();
assertTrue(!e.containsErrors() ? "" : "Found error " + e.getFirstError().getMessage(), !e.containsErrors());
assertInferOk(code);
}
use of abs.frontend.typechecker.locationtypes.LocationTypeExtension in project abstools by abstools.
the class LocationTypeInferrerExtension method finished.
@Override
public void finished() {
if (enablesStats) {
for (int i = 0; i < 4; i++) {
SatGenerator satGen = new SatGenerator(constraints);
// satGen.enableStats = enablesStats;
results = satGen.generate(errors);
}
}
SatGenerator satGen = new SatGenerator(constraints);
satGen.enableStats = enablesStats;
results = satGen.generate(errors);
if (!errors.containsErrors()) {
SemanticConditionList sel = new SemanticConditionList();
List<TypeSystemExtension> curr = model.getTypeExt().getTypeSystemExtensionList();
model.getTypeExt().clearTypeSystemExtensions();
model.getTypeExt().register(new LocationTypeExtension(model, this));
model.typeCheck(sel);
errors.addAll(sel);
model.getTypeExt().clearTypeSystemExtensions();
model.getTypeExt().registerAll(curr);
}
}
Aggregations