Search in sources :

Example 16 with RawTerm

use of catdata.aql.RawTerm in project fql by CategoricalData.

the class CombinatorParser method mapExpRaw.

// TODO: aql reverse order on arguments env
private static Parser<MapExpRaw> mapExpRaw() {
    Parser<List<catdata.Pair<LocStr, List<String>>>> fks = Parsers.tuple(token("foreign_keys"), env(ident.sepBy1(token(".")), "->")).map(x -> x.b);
    Parser<Tuple5<Token, String, Pair<Token, String>, Token, RawTerm>> lp0 = Parsers.tuple(token("lambda"), ident, Parsers.tuple(token(":"), ident).optional(), token("."), term());
    Parser<Tuple5<Token, String, Pair<Token, String>, Token, RawTerm>> lq = ident.sepBy1(token(".")).map(x -> {
        // TODO aql
        RawTerm term = RawTerm.fold(x, "_x");
        return new Tuple5<>(null, "_x", new Pair<>(null, null), null, term);
    });
    Parser<Tuple5<Token, String, Pair<Token, String>, Token, RawTerm>> lp = Parsers.or(lp0, lq);
    Parser<List<catdata.Pair<LocStr, Triple<String, String, RawTerm>>>> envp = env(lp.map(x -> new Triple<>(x.b, x.c == null ? null : x.c.b, x.e)), "->");
    Parser<List<catdata.Pair<LocStr, Triple<String, String, RawTerm>>>> atts = Parsers.tuple(token("attributes"), envp).map(x -> x.b);
    // List<Pair<LocStr, Triple<String, List<Pair<LocStr, List<String>>>,
    // List<Pair<LocStr, Triple<String, String, RawTerm>>>>>> list,
    Parser<List<catdata.Pair<LocStr, String>>> ens = Parsers.tuple(token("entities"), env(ident, "->")).map(x -> x.b);
    Parser<Tuple3<List<LocStr>, List<catdata.Pair<LocStr, Triple<String, List<catdata.Pair<LocStr, List<String>>>, List<catdata.Pair<LocStr, Triple<String, String, RawTerm>>>>>>, List<catdata.Pair<String, String>>>> pa = Parsers.tuple(imports, Parsers.tuple(token("entity"), locstr.followedBy(token("->")), ident, fks.optional(), atts.optional()).map(x -> new catdata.Pair<>(x.b, new Triple<>(x.c, Util.newIfNull(x.d), Util.newIfNull(x.e)))).many(), options);
    Parser<Tuple5<Token, Token, SchExp<?, ?, ?, ?, ?>, SchExp<?, ?, ?, ?, ?>, Token>> l = Parsers.tuple(token("literal"), token(":"), sch_ref.lazy().followedBy(token("->")), sch_ref.lazy(), token("{"));
    // List<Pair<LocStr, Triple<String, List<Pair<LocStr, List<String>>>,
    // List<Pair<LocStr, Triple<String, String, RawTerm>>>>>> list,
    Parser<MapExpRaw> ret = Parsers.tuple(l, pa, token("}")).map(x -> new MapExpRaw(x.a.c, x.a.d, x.b.a, x.b.b, x.b.c));
    return ret;
}
Also used : AqlOptions(catdata.aql.AqlOptions) PragmaExpProc(catdata.aql.exp.PragmaExp.PragmaExpProc) Scanners(org.jparsec.Scanners) InstExpDelta(catdata.aql.exp.InstExp.InstExpDelta) GraphExpVar(catdata.aql.exp.GraphExp.GraphExpVar) GraphExpRaw(catdata.aql.exp.GraphExp.GraphExpRaw) StringLiteral(org.jparsec.Terminals.StringLiteral) EdsExpVar(catdata.aql.exp.EdsExp.EdsExpVar) SchExpInst(catdata.aql.exp.SchExp.SchExpInst) Pair(org.jparsec.functors.Pair) TransExpSigmaDeltaCounit(catdata.aql.exp.TransExp.TransExpSigmaDeltaCounit) QueryExpCompose(catdata.aql.exp.QueryExp.QueryExpCompose) PragmaExpConsistent(catdata.aql.exp.PragmaExp.PragmaExpConsistent) ParseException(catdata.ParseException) Quad(catdata.Quad) PragmaExpSql(catdata.aql.exp.PragmaExp.PragmaExpSql) SchExpVar(catdata.aql.exp.SchExp.SchExpVar) Parser(org.jparsec.Parser) InstExpColim(catdata.aql.exp.InstExp.InstExpColim) QueryExpDeltaCoEval(catdata.aql.exp.QueryExp.QueryExpDeltaCoEval) IntegerLiteral(org.jparsec.Terminals.IntegerLiteral) Program(catdata.Program) Triple(catdata.Triple) PragmaExpJs(catdata.aql.exp.PragmaExp.PragmaExpJs) PragmaExpCheck(catdata.aql.exp.PragmaExp.PragmaExpCheck) Ty(catdata.aql.exp.TyExpRaw.Ty) Terminals(org.jparsec.Terminals) PragmaExpMatch(catdata.aql.exp.PragmaExp.PragmaExpMatch) MapExpVar(catdata.aql.exp.MapExp.MapExpVar) TransExpDistinct(catdata.aql.exp.TransExp.TransExpDistinct) TyExpEmpty(catdata.aql.exp.TyExp.TyExpEmpty) TransExpVar(catdata.aql.exp.TransExp.TransExpVar) ColimSchExpQuotient(catdata.aql.exp.ColimSchExp.ColimSchExpQuotient) Token(org.jparsec.Token) PragmaExpToCsvInst(catdata.aql.exp.PragmaExp.PragmaExpToCsvInst) MapExpComp(catdata.aql.exp.MapExp.MapExpComp) InstExpCoEq(catdata.aql.exp.InstExp.InstExpCoEq) InstExpCod(catdata.aql.exp.InstExp.InstExpCod) InstExpCoProdFull(catdata.aql.exp.InstExp.InstExpCoProdFull) Att(catdata.aql.exp.SchExpRaw.Att) TransExpCoEvalEvalCoUnit(catdata.aql.exp.TransExp.TransExpCoEvalEvalCoUnit) TransExpDelta(catdata.aql.exp.TransExp.TransExpDelta) SchExpEmpty(catdata.aql.exp.SchExp.SchExpEmpty) ParserException(org.jparsec.error.ParserException) PragmaExpToJdbcTrans(catdata.aql.exp.PragmaExp.PragmaExpToJdbcTrans) Trans(catdata.aql.exp.QueryExpRaw.Trans) SchExpCod(catdata.aql.exp.SchExp.SchExpCod) InstExpChase(catdata.aql.exp.InstExp.InstExpChase) PragmaExpToJdbcQuery(catdata.aql.exp.PragmaExp.PragmaExpToJdbcQuery) InstExpFrozen(catdata.aql.exp.InstExp.InstExpFrozen) Sym(catdata.aql.exp.TyExpRaw.Sym) Tuple3(org.jparsec.functors.Tuple3) PragmaExpVar(catdata.aql.exp.PragmaExp.PragmaExpVar) Tuple4(org.jparsec.functors.Tuple4) Tuple5(org.jparsec.functors.Tuple5) InstExpAnonymize(catdata.aql.exp.InstExp.InstExpAnonymize) InstExpSigma(catdata.aql.exp.InstExp.InstExpSigma) TransExpEval(catdata.aql.exp.TransExp.TransExpEval) InstExpCoProdSigma(catdata.aql.exp.InstExp.InstExpCoProdSigma) InstExpVar(catdata.aql.exp.InstExp.InstExpVar) PreBlock(catdata.aql.exp.QueryExpRaw.PreBlock) TransExpSigmaDeltaUnit(catdata.aql.exp.TransExp.TransExpSigmaDeltaUnit) EdExpRaw(catdata.aql.exp.EdsExpRaw.EdExpRaw) Collectors(java.util.stream.Collectors) List(java.util.List) InstExpDom(catdata.aql.exp.InstExp.InstExpDom) Parsers(org.jparsec.Parsers) InstExpCoEval(catdata.aql.exp.InstExp.InstExpCoEval) TransExpSigma(catdata.aql.exp.TransExp.TransExpSigma) TransExpId(catdata.aql.exp.TransExp.TransExpId) MapExpId(catdata.aql.exp.MapExp.MapExpId) RawTerm(catdata.aql.RawTerm) En(catdata.aql.exp.SchExpRaw.En) InstExpSigmaChase(catdata.aql.exp.InstExp.InstExpSigmaChase) HashMap(java.util.HashMap) QueryExpDeltaEval(catdata.aql.exp.QueryExp.QueryExpDeltaEval) InstExpPi(catdata.aql.exp.InstExp.InstExpPi) ColimSchExpVar(catdata.aql.exp.ColimSchExp.ColimSchExpVar) ColimSchExpRaw(catdata.aql.exp.ColimSchExp.ColimSchExpRaw) PragmaExpLoadJars(catdata.aql.exp.PragmaExp.PragmaExpLoadJars) LinkedList(java.util.LinkedList) PragmaExpToCsvTrans(catdata.aql.exp.PragmaExp.PragmaExpToCsvTrans) Fk(catdata.aql.exp.SchExpRaw.Fk) TyExpSch(catdata.aql.exp.TyExp.TyExpSch) Reference(org.jparsec.Parser.Reference) ColimSchExpWrap(catdata.aql.exp.ColimSchExp.ColimSchExpWrap) Util(catdata.Util) QueryExpId(catdata.aql.exp.QueryExp.QueryExpId) QueryExpVar(catdata.aql.exp.QueryExp.QueryExpVar) InstExpEval(catdata.aql.exp.InstExp.InstExpEval) TransExpCoEval(catdata.aql.exp.TransExp.TransExpCoEval) TyExpVar(catdata.aql.exp.TyExp.TyExpVar) Identifier(org.jparsec.Terminals.Identifier) InstExpDistinct(catdata.aql.exp.InstExp.InstExpDistinct) PragmaExpToJdbcInst(catdata.aql.exp.PragmaExp.PragmaExpToJdbcInst) TransExpCoEvalEvalUnit(catdata.aql.exp.TransExp.TransExpCoEvalEvalUnit) Collections(java.util.Collections) InstExpEmpty(catdata.aql.exp.InstExp.InstExpEmpty) Token(org.jparsec.Token) RawTerm(catdata.aql.RawTerm) Triple(catdata.Triple) Tuple5(org.jparsec.functors.Tuple5) Tuple3(org.jparsec.functors.Tuple3) List(java.util.List) LinkedList(java.util.LinkedList) Pair(org.jparsec.functors.Pair)

Example 17 with RawTerm

use of catdata.aql.RawTerm in project fql by CategoricalData.

the class CombinatorParser method instExpQuotient.

private static Parser<InstExpQuotient<?, ?>> instExpQuotient() {
    Parser<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>> eq = Parsers.tuple(Parsers.INDEX, Parsers.tuple(term(), token("="), term())).map(x -> new catdata.Pair<>(x.a, new catdata.Pair<>(x.b.a, x.b.c)));
    Parser<List<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>>> eqs = Parsers.tuple(token("equations"), eq.many()).map(x -> x.b);
    Parser<List<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>>> table = Parsers.tuple(Parsers.INDEX, Parsers.tuple(ident, token("->"), token("{"), Parsers.tuple(term(), term()).sepBy(token(",")), token("}"))).map(x -> {
        List<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>> ret = new LinkedList<>();
        for (Pair<RawTerm, RawTerm> y : x.b.d) {
            ret.add(new catdata.Pair<>(x.a, new catdata.Pair<>(new RawTerm(x.b.a, Util.singList(y.a)), y.b)));
        }
        return ret;
    });
    Parser<List<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>>> tables = Parsers.tuple(token("multi_equations"), table.many()).map(x -> Util.concat(x.b));
    Parser<Tuple3<List<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>>, List<catdata.Pair<Integer, catdata.Pair<RawTerm, RawTerm>>>, List<catdata.Pair<String, String>>>> pa = Parsers.tuple(eqs.optional(), tables.optional(), options);
    Parser<Tuple3<Token, InstExp<?, ?, ?, ?, ?, ?, ?, ?, ?>, Token>> l = Parsers.tuple(token("quotient"), inst_ref.lazy(), // .map(x -> x.c);
    token("{"));
    Parser<InstExpQuotient<?, ?>> ret = Parsers.tuple(l, pa, token("}")).map(x -> new InstExpQuotient(x.a.b, new LinkedList<>(Util.append(Util.newIfNull(x.b.a), Util.newIfNull(x.b.b))), x.b.c));
    return ret;
}
Also used : RawTerm(catdata.aql.RawTerm) LinkedList(java.util.LinkedList) Tuple3(org.jparsec.functors.Tuple3) List(java.util.List) LinkedList(java.util.LinkedList) Pair(org.jparsec.functors.Pair)

Example 18 with RawTerm

use of catdata.aql.RawTerm in project fql by CategoricalData.

the class CombinatorParser method term.

// public static final Parser<?> program = program().from(TOKENIZER,
// IGNORED);
// public static final Parser<?> program() {
// return Parsers.tuple(decl().source().peek(), decl()).many();
// }
private static Parser<RawTerm> term() {
    Reference<RawTerm> ref = Parser.newReference();
    Parser<RawTerm> ann = Parsers.tuple(ident, token("@"), ident).map(x -> new RawTerm(x.a, x.c));
    Parser<RawTerm> app = Parsers.tuple(ident, token("("), ref.lazy().sepBy(token(",")), token(")")).map(x -> new RawTerm(x.a, x.c));
    /*
		 * Parser<RawTerm> appH = Parsers.tuple(ident, ref.lazy().many()).map(x -> {
		 * return new RawTerm(x.a, x.b); });
		 */
    // appH probs won't work
    Parser<RawTerm> app2 = Parsers.tuple(token("("), ref.lazy(), ident, ref.lazy(), token(")")).map(x -> new RawTerm(x.c, Util.list(x.b, x.d)));
    Parser<RawTerm> sing = ident.map(x -> new RawTerm(x, new LinkedList<>()));
    // use of ref.lazy for first argument leads to left recursion
    Parser<RawTerm> dot = Parsers.tuple(ident.label("\n\n **** Possible problem: only identifiers allowed in . notation (lest left-recusion ensue)\n\n"), (Parsers.tuple(token("."), ident).map(x -> x.b)).many1()).map(x -> {
        RawTerm r = new RawTerm(x.a, Collections.emptyList());
        for (String s : x.b) {
            r = new RawTerm(s, Util.singList(r));
        }
        return r;
    });
    // conflicts with
    Parser<RawTerm> ret = Parsers.or(ann, app, app2, dot, /* appH, */
    sing);
    // infix?
    // TODO aql
    ref.set(ret);
    return ret;
}
Also used : RawTerm(catdata.aql.RawTerm) LinkedList(java.util.LinkedList)

Example 19 with RawTerm

use of catdata.aql.RawTerm in project fql by CategoricalData.

the class EasikAql method translateC.

private static List<Pair<String, EdsExpRaw>> translateC(Node sketch, Set<String> warnings, SchExp<?, ?, ?, ?, ?> schExp) {
    List<Pair<String, EdsExpRaw>> edsExps = new LinkedList<>();
    NodeList l = sketch.getChildNodes();
    for (int temp = 0; temp < l.getLength(); temp++) {
        Node n = l.item(temp);
        NodeList j = n.getChildNodes();
        for (int temp2 = 0; temp2 < j.getLength(); temp2++) {
            Node m = j.item(temp2);
            List<EdExpRaw> edExps = new LinkedList<>();
            String name = null;
            if (m.getNodeName().equals("sumconstraint")) {
                warnings.add("sum constraints not exported - AQL does not currently support sum constraints");
                continue;
            } else if (m.getNodeName().equals("limitconstraint")) {
                warnings.add("limit constraints not exported - if you see this, please report");
                continue;
            } else if (m.getNodeName().equals("pullbackconstraint")) {
                name = "pullback";
                Pair<List<String>, String> f1 = null, f2 = null, g1 = null, g2 = null;
                for (int i = 0; i < m.getChildNodes().getLength(); i++) {
                    Node x = m.getChildNodes().item(i);
                    if (x.getNodeName().equals("path")) {
                        if (g1 == null) {
                            g1 = path(x);
                        } else if (g2 == null) {
                            g2 = path(x);
                        } else if (f1 == null) {
                            f1 = path(x);
                        } else if (f2 == null) {
                            f2 = path(x);
                        }
                    }
                }
                if (f1 == null || g1 == null || f2 == null || g2 == null) {
                    throw new RuntimeException("Anomaly - please report");
                }
                String A = f1.first.get(0);
                String B = f1.second;
                String C = g1.second;
                f1.first.remove(0);
                g1.first.remove(0);
                g2.first.remove(0);
                f2.first.remove(0);
                List<Pair<String, String>> as = new LinkedList<>();
                as.add(new Pair<>("b", B));
                as.add(new Pair<>("c", C));
                List<Pair<RawTerm, RawTerm>> a_eqs = new LinkedList<>();
                a_eqs.add(new Pair<>(toTerm(f2.first, "b"), toTerm(g2.first, "c")));
                List<Pair<String, String>> es = new LinkedList<>();
                es.add(new Pair<>("a", A));
                List<Pair<RawTerm, RawTerm>> e_eqs = new LinkedList<>();
                e_eqs.add(new Pair<>(toTerm(f1.first, "a"), new RawTerm("b")));
                e_eqs.add(new Pair<>(toTerm(g1.first, "a"), new RawTerm("c")));
                EdExpRaw ed1 = new EdExpRaw(as, a_eqs, es, e_eqs, true, null);
                edExps.add(ed1);
            /*
					as = new LinkedList<>();
					as.add(new Pair<>("a1", A));
					as.add(new Pair<>("a2", A));
					a_eqs = new LinkedList<>();
					a_eqs.add(new Pair<>(toTerm(f1.first, "a1"),toTerm(f1.first, "a2")));					
					a_eqs.add(new Pair<>(toTerm(g1.first, "a1"),toTerm(g1.first, "a2")));					
					es = new LinkedList<>();
					e_eqs = new LinkedList<>();
					e_eqs.add(new Pair<>(new RawTerm("a1"),new RawTerm("a2")));
					EdExpRaw ed2 = new EdExpRaw(as, a_eqs, es, e_eqs);
					edExps.add(ed2);					
					*/
            } else if (m.getNodeName().equals("productconstraint")) {
                name = "product";
                Pair<List<String>, String> f = null, g = null;
                for (int i = 0; i < m.getChildNodes().getLength(); i++) {
                    Node x = m.getChildNodes().item(i);
                    if (x.getNodeName().equals("path")) {
                        if (f == null) {
                            f = path(x);
                        } else if (g == null) {
                            g = path(x);
                        }
                    }
                }
                if (f == null || g == null) {
                    throw new RuntimeException("Anomaly - please report");
                }
                String A = f.first.get(0);
                String B = f.second;
                String C = g.second;
                f.first.remove(0);
                g.first.remove(0);
                List<Pair<String, String>> as = new LinkedList<>();
                as.add(new Pair<>("b", B));
                as.add(new Pair<>("c", C));
                List<Pair<RawTerm, RawTerm>> a_eqs = new LinkedList<>();
                List<Pair<String, String>> es = new LinkedList<>();
                es.add(new Pair<>("a", A));
                List<Pair<RawTerm, RawTerm>> e_eqs = new LinkedList<>();
                e_eqs.add(new Pair<>(toTerm(f.first, "a"), new RawTerm("b")));
                e_eqs.add(new Pair<>(toTerm(g.first, "a"), new RawTerm("c")));
                EdExpRaw ed1 = new EdExpRaw(as, a_eqs, es, e_eqs, true, null);
                edExps.add(ed1);
            } else if (m.getNodeName().equals("equalizerconstraint")) {
                List<String> h = null, f = null, g = null;
                for (int i = 0; i < m.getChildNodes().getLength(); i++) {
                    Node x = m.getChildNodes().item(i);
                    if (x.getNodeName().equals("path")) {
                        if (h == null) {
                            h = path(x).first;
                        } else if (f == null) {
                            f = path(x).first;
                        } else if (g == null) {
                            g = path(x).first;
                        }
                    }
                }
                if (h == null || f == null || g == null) {
                    throw new RuntimeException("Anomaly - please report");
                }
                String B = f.get(0);
                String A = h.get(0);
                h.remove(0);
                f.remove(0);
                g.remove(0);
                List<Pair<String, String>> as = new LinkedList<>();
                as.add(new Pair<>("b", B));
                List<Pair<RawTerm, RawTerm>> a_eqs = new LinkedList<>();
                a_eqs.add(new Pair<>(toTerm(f, "b"), toTerm(g, "b")));
                List<Pair<String, String>> es = new LinkedList<>();
                es.add(new Pair<>("a", A));
                List<Pair<RawTerm, RawTerm>> e_eqs = new LinkedList<>();
                e_eqs.add(new Pair<>(toTerm(h, "a"), new RawTerm("b")));
                EdExpRaw ed1 = new EdExpRaw(as, a_eqs, es, e_eqs, true, null);
                edExps.add(ed1);
                name = "equalizer";
            } else {
                continue;
            }
            EdsExpRaw edsExp = new EdsExpRaw(schExp, new LinkedList<>(), edExps, null);
            edsExps.add(new Pair<>(name, edsExp));
        }
    }
    return edsExps;
}
Also used : NodeList(org.w3c.dom.NodeList) Node(org.w3c.dom.Node) EdExpRaw(catdata.aql.exp.EdsExpRaw.EdExpRaw) RawTerm(catdata.aql.RawTerm) LinkedList(java.util.LinkedList) NodeList(org.w3c.dom.NodeList) List(java.util.List) LinkedList(java.util.LinkedList) Pair(catdata.Pair)

Example 20 with RawTerm

use of catdata.aql.RawTerm in project fql by CategoricalData.

the class QueryExpRawSimple method eval.

// TODO aql merge with queryexpraw
@Override
public Query<Ty, En, Sym, Fk, Att, En, Fk, Att> eval(AqlEnv env) {
    Schema<Ty, En, Sym, Fk, Att> src0 = src.eval(env);
    Collage<Ty, En, Sym, Fk, Att, Void, Void> srcCol = src0.collage();
    En En = new En("Q");
    AqlOptions ops = new AqlOptions(block.options, null, env.defaults);
    boolean doNotCheckEqs = (Boolean) ops.getOrDefault(AqlOption.dont_validate_unsafe);
    boolean elimRed = (Boolean) ops.getOrDefault(AqlOption.query_remove_redundancy);
    boolean checkJava = !(Boolean) ops.getOrDefault(AqlOption.allow_java_eqs_unsafe);
    Ctx<En, Triple<Ctx<Var, En>, Collection<Eq<Ty, En, Sym, Fk, Att, Var, Var>>, AqlOptions>> ens0 = new Ctx<>();
    Ctx<Att, Term<Ty, En, Sym, Fk, Att, Var, Var>> atts0 = new Ctx<>();
    Ctx<Fk, Pair<Ctx<Var, Term<Void, En, Void, Fk, Void, Var, Void>>, Boolean>> fks0 = new Ctx<>();
    Ctx<En, Collage<Ty, En, Sym, Fk, Att, Var, Var>> cols = new Ctx<>();
    QueryExpRaw.processBlock(block.options, env, src0, ens0, cols, block, new Ctx<>());
    Collage<Ty, En, Sym, Fk, Att, Void, Void> colForDst = new Collage<>(src0.typeSide.collage());
    colForDst.ens.add(En);
    for (Pair<Att, RawTerm> p : block.atts) {
        Map<String, Chc<Ty, En>> s = QueryExpRaw.unVar(cols.get(En).gens).<Ty>inRight().map;
        Term<Ty, catdata.aql.exp.SchExpRaw.En, Sym, Fk, Att, Gen, Sk> term = RawTerm.infer1x(s, p.second, p.second, null, srcCol.convert(), "", src0.typeSide.js).second;
        Chc<Ty, En> ty = srcCol.type(new Ctx<>(s).map((k, v) -> new Pair<>(new Var(k), v)), term.convert());
        if (!ty.left) {
            throw new LocException(find("attributes", p), "In return clause for " + p.first + ", the type is " + ty.r + ", which is an entity.");
        }
        colForDst.atts.put(p.first, new Pair<>(En, ty.l));
    }
    DP<Ty, En, Sym, Fk, Att, Void, Void> dp = AqlProver.create(ops, colForDst, src0.typeSide.js);
    Schema<Ty, En, Sym, Fk, Att> dst0 = new Schema<Ty, En, Sym, Fk, Att>(src0.typeSide, colForDst.ens, colForDst.atts.map, colForDst.fks.map, new HashSet<>(), dp, checkJava);
    for (Pair<Att, RawTerm> p : block.atts) {
        try {
            QueryExpRaw.processAtt(src0, dst0, ens0, atts0, cols, p, new Ctx<>());
        } catch (RuntimeException ex) {
            ex.printStackTrace();
            throw new LocException(find("attributes", p), "In return clause for " + p.first + ", " + ex.getMessage());
        }
    }
    // TODO aql
    return Query.makeQuery(ens0, atts0, fks0, src0, dst0, doNotCheckEqs, elimRed);
}
Also used : Att(catdata.aql.exp.SchExpRaw.Att) AqlOptions(catdata.aql.AqlOptions) Ctx(catdata.Ctx) RawTerm(catdata.aql.RawTerm) En(catdata.aql.exp.SchExpRaw.En) Sym(catdata.aql.exp.TyExpRaw.Sym) Chc(catdata.Chc) Gen(catdata.aql.exp.InstExpRaw.Gen) AqlOption(catdata.aql.AqlOptions.AqlOption) AqlProver(catdata.aql.AqlProver) HashSet(java.util.HashSet) Map(java.util.Map) Collage(catdata.aql.Collage) DP(catdata.aql.DP) Eq(catdata.aql.Eq) Term(catdata.aql.Term) LinkedList(java.util.LinkedList) Pair(catdata.Pair) Fk(catdata.aql.exp.SchExpRaw.Fk) PreBlock(catdata.aql.exp.QueryExpRaw.PreBlock) Block(catdata.aql.exp.QueryExpRaw.Block) Collection(java.util.Collection) Kind(catdata.aql.Kind) Util(catdata.Util) Query(catdata.aql.Query) Att(catdata.aql.exp.SchExpRaw.Att) List(java.util.List) Schema(catdata.aql.Schema) Var(catdata.aql.Var) Sk(catdata.aql.exp.InstExpRaw.Sk) Triple(catdata.Triple) SchExpCod(catdata.aql.exp.SchExp.SchExpCod) Collections(java.util.Collections) Ty(catdata.aql.exp.TyExpRaw.Ty) Var(catdata.aql.Var) Ctx(catdata.Ctx) Schema(catdata.aql.Schema) En(catdata.aql.exp.SchExpRaw.En) Eq(catdata.aql.Eq) Pair(catdata.Pair) Ty(catdata.aql.exp.TyExpRaw.Ty) Fk(catdata.aql.exp.SchExpRaw.Fk) Sym(catdata.aql.exp.TyExpRaw.Sym) RawTerm(catdata.aql.RawTerm) Term(catdata.aql.Term) RawTerm(catdata.aql.RawTerm) Triple(catdata.Triple) Gen(catdata.aql.exp.InstExpRaw.Gen) Sk(catdata.aql.exp.InstExpRaw.Sk) AqlOptions(catdata.aql.AqlOptions) Collage(catdata.aql.Collage) Chc(catdata.Chc)

Aggregations

RawTerm (catdata.aql.RawTerm)23 LinkedList (java.util.LinkedList)18 Ty (catdata.aql.exp.TyExpRaw.Ty)15 List (java.util.List)15 En (catdata.aql.exp.SchExpRaw.En)13 Sym (catdata.aql.exp.TyExpRaw.Sym)13 Att (catdata.aql.exp.SchExpRaw.Att)12 Fk (catdata.aql.exp.SchExpRaw.Fk)12 Ctx (catdata.Ctx)11 AqlOptions (catdata.aql.AqlOptions)11 Term (catdata.aql.Term)11 Chc (catdata.Chc)10 Pair (catdata.Pair)10 Triple (catdata.Triple)9 Collage (catdata.aql.Collage)9 Gen (catdata.aql.exp.InstExpRaw.Gen)8 Sk (catdata.aql.exp.InstExpRaw.Sk)8 HashSet (java.util.HashSet)8 Var (catdata.aql.Var)7 HashMap (java.util.HashMap)7