use of catdata.aql.TypeSide in project fql by CategoricalData.
the class TyExpRaw method eval.
@Override
public synchronized TypeSide<Ty, Sym> eval(AqlEnv env) {
AqlOptions ops = new AqlOptions(options, col, env.defaults);
// changed my mind: do not defer equation checking since invokes javascript
// col.
AqlJs<Ty, Sym> js = new AqlJs<>(col.syms, col.java_tys, col.java_parsers, col.java_fns);
for (Triple<List<Pair<String, String>>, RawTerm, RawTerm> eq : eqs) {
try {
Triple<Ctx<Var, Chc<Ty, Void>>, Term<Ty, Void, Sym, Void, Void, Void, Void>, Term<Ty, Void, Sym, Void, Void, Void, Void>> tr = infer1x(yyy(eq.first), eq.second, eq.third, null, col, "", js);
col.eqs.add(new Eq<>(tr.first, tr.second, tr.third));
} catch (RuntimeException ex) {
ex.printStackTrace();
throw new LocException(find("equations", eq), "In equation " + eq.second + " = " + eq.third + ", " + ex.getMessage());
}
}
for (Pair<Integer, TyExp<Ty, Sym>> k : imports) {
TypeSide<Ty, Sym> v = k.second.eval(env);
col.addAll(v.collage());
}
Set<Triple<Ctx<Var, Ty>, Term<Ty, Void, Sym, Void, Void, Void, Void>, Term<Ty, Void, Sym, Void, Void, Void, Void>>> eqs0 = col.eqsAsTriples().stream().map(x -> new Triple<>(xxx(x.first), x.second, x.third)).collect(Collectors.toSet());
TypeSide<Ty, Sym> ret = new TypeSide<Ty, Sym>(col.tys, col.syms.map, eqs0, col.java_tys.map, col.java_parsers.map, col.java_fns.map, ops);
return ret;
}
Aggregations