@@ -250,25 +188,6 @@ requiredType ctx t = case parent t of
ty<-requiredTypectxp
(ty1,ty2)<-matchProdty(showp)
returnty2
-- TODO: What does that mean for a map function that contains the call site?
-- Basic Idea: transform the map call into a find call where the predicate is the guard within the map that precedes the checkType call
-- We know what we want to select, but how can we derive which projections are needed?
-- TODO: Are the functions (map, find) valid in Datalog? What do the correspond to?
-- TODO: this code does not work the way it should be? We need to find the entry that belongs to the term in question and check that the labels are the same in the zipped list. This results in a guard t == t' && x == x'
-- x == x' can be derived based on the the guard in the map function call
-- TODO: How can we derive the other guard t == t'? Is this basically the top level guard?
Justp@(Rectpairs_)->do
ty<-requiredTypectxp
typairs<-matchRecordty(showp)
iflengthtpairs==lengthtypairs
thendo
-- TODO what happens if two labels have the same term?
-- TODO what happens if a label is used twice in a record?