mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Implement TypeInfererLet::getLetConstraints()
This commit is contained in:
parent
e31cb5efeb
commit
622851aaaa
@ -33,10 +33,18 @@ public class TypeInfererLet extends TypeInferer {
|
||||
* C := { αi = σ(αi) | σ defined for αi }
|
||||
*
|
||||
* @return the constraints needed in the outer inference
|
||||
* @throws IllegalStateException if the method is called despite missing mgu
|
||||
*/
|
||||
public List<Constraint> getLetConstraints() {
|
||||
return new ArrayList<>();
|
||||
// TODO
|
||||
if (this.getMGU().isEmpty()) {
|
||||
throw new IllegalStateException("getLetConstraints() should never be called when no mgu was found");
|
||||
}
|
||||
List<Constraint> letConstraints = new ArrayList<>();
|
||||
for (Substitution substitution : this.getMGU().get()) {
|
||||
Constraint constraint = new Constraint(substitution.getVariable(), substitution.getType());
|
||||
letConstraints.add(constraint);
|
||||
}
|
||||
return letConstraints;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user