Commit b6967f9a authored by Fred Eisele's avatar Fred Eisele
Browse files

resolve unchecked cast warnings

parent fa1a714b
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/f90/-ru88jt/AqlLexerRules.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
......
This diff is collapsed.
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/f90/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.ParserRuleContext;
......@@ -1175,18 +1175,6 @@ public class AqlParserBaseListener implements AqlParserListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaExp_OfInstance(AqlParser.SchemaExp_OfInstanceContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSchemaExp_Destination(AqlParser.SchemaExp_DestinationContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaExp_Destination(AqlParser.SchemaExp_DestinationContext ctx) { }
/**
* {@inheritDoc}
*
......@@ -4187,6 +4175,30 @@ public class AqlParserBaseListener implements AqlParserListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSchemaColimitQuotientSection(AqlParser.SchemaColimitQuotientSectionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterScQuotientEqu(AqlParser.ScQuotientEquContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitScQuotientEqu(AqlParser.ScQuotientEquContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterScQuotientFkEqu(AqlParser.ScQuotientFkEquContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitScQuotientFkEqu(AqlParser.ScQuotientFkEquContext ctx) { }
/**
* {@inheritDoc}
*
......@@ -4216,37 +4228,37 @@ public class AqlParserBaseListener implements AqlParserListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterScEntityPath(AqlParser.ScEntityPathContext ctx) { }
@Override public void enterScGenType(AqlParser.ScGenTypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitScEntityPath(AqlParser.ScEntityPathContext ctx) { }
@Override public void exitScGenType(AqlParser.ScGenTypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterScFkPath(AqlParser.ScFkPathContext ctx) { }
@Override public void enterScTermPath_Dotted(AqlParser.ScTermPath_DottedContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitScFkPath(AqlParser.ScFkPathContext ctx) { }
@Override public void exitScTermPath_Dotted(AqlParser.ScTermPath_DottedContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterScAttrPath(AqlParser.ScAttrPathContext ctx) { }
@Override public void enterScTermPath_Singular(AqlParser.ScTermPath_SingularContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitScAttrPath(AqlParser.ScAttrPathContext ctx) { }
@Override public void exitScTermPath_Singular(AqlParser.ScTermPath_SingularContext ctx) { }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/f90/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
......@@ -690,13 +690,6 @@ public class AqlParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> impleme
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchemaExp_OfInstance(AqlParser.SchemaExp_OfInstanceContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchemaExp_Destination(AqlParser.SchemaExp_DestinationContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......@@ -2447,6 +2440,20 @@ public class AqlParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> impleme
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSchemaColimitQuotientSection(AqlParser.SchemaColimitQuotientSectionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitScQuotientEqu(AqlParser.ScQuotientEquContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitScQuotientFkEqu(AqlParser.ScQuotientFkEquContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......@@ -2467,21 +2474,21 @@ public class AqlParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> impleme
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitScEntityPath(AqlParser.ScEntityPathContext ctx) { return visitChildren(ctx); }
@Override public T visitScGenType(AqlParser.ScGenTypeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitScFkPath(AqlParser.ScFkPathContext ctx) { return visitChildren(ctx); }
@Override public T visitScTermPath_Dotted(AqlParser.ScTermPath_DottedContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitScAttrPath(AqlParser.ScAttrPathContext ctx) { return visitChildren(ctx); }
@Override public T visitScTermPath_Singular(AqlParser.ScTermPath_SingularContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/f90/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeListener;
......@@ -1033,18 +1033,6 @@ public interface AqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitSchemaExp_OfInstance(AqlParser.SchemaExp_OfInstanceContext ctx);
/**
* Enter a parse tree produced by the {@code SchemaExp_Destination}
* labeled alternative in {@link AqlParser#schemaExp}.
* @param ctx the parse tree
*/
void enterSchemaExp_Destination(AqlParser.SchemaExp_DestinationContext ctx);
/**
* Exit a parse tree produced by the {@code SchemaExp_Destination}
* labeled alternative in {@link AqlParser#schemaExp}.
* @param ctx the parse tree
*/
void exitSchemaExp_Destination(AqlParser.SchemaExp_DestinationContext ctx);
/**
* Enter a parse tree produced by the {@code SchemaExp_GetSchemaColimit}
* labeled alternative in {@link AqlParser#schemaExp}.
......@@ -3787,6 +3775,26 @@ public interface AqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitSchemaColimitQuotientSection(AqlParser.SchemaColimitQuotientSectionContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#scQuotientEqu}.
* @param ctx the parse tree
*/
void enterScQuotientEqu(AqlParser.ScQuotientEquContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#scQuotientEqu}.
* @param ctx the parse tree
*/
void exitScQuotientEqu(AqlParser.ScQuotientEquContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#scQuotientFkEqu}.
* @param ctx the parse tree
*/
void enterScQuotientFkEqu(AqlParser.ScQuotientFkEquContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#scQuotientFkEqu}.
* @param ctx the parse tree
*/
void exitScQuotientFkEqu(AqlParser.ScQuotientFkEquContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#scObsEquation}.
* @param ctx the parse tree
......@@ -3808,35 +3816,39 @@ public interface AqlParserListener extends ParseTreeListener {
*/
void exitScGen(AqlParser.ScGenContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#scEntityPath}.
* Enter a parse tree produced by {@link AqlParser#scGenType}.
* @param ctx the parse tree
*/
void enterScEntityPath(AqlParser.ScEntityPathContext ctx);
void enterScGenType(AqlParser.ScGenTypeContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#scEntityPath}.
* Exit a parse tree produced by {@link AqlParser#scGenType}.
* @param ctx the parse tree
*/
void exitScEntityPath(AqlParser.ScEntityPathContext ctx);
void exitScGenType(AqlParser.ScGenTypeContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#scFkPath}.
* Enter a parse tree produced by the {@code ScTermPath_Dotted}
* labeled alternative in {@link AqlParser#scTermPath}.
* @param ctx the parse tree
*/
void enterScFkPath(AqlParser.ScFkPathContext ctx);
void enterScTermPath_Dotted(AqlParser.ScTermPath_DottedContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#scFkPath}.
* Exit a parse tree produced by the {@code ScTermPath_Dotted}
* labeled alternative in {@link AqlParser#scTermPath}.
* @param ctx the parse tree
*/
void exitScFkPath(AqlParser.ScFkPathContext ctx);
void exitScTermPath_Dotted(AqlParser.ScTermPath_DottedContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#scAttrPath}.
* Enter a parse tree produced by the {@code ScTermPath_Singular}
* labeled alternative in {@link AqlParser#scTermPath}.
* @param ctx the parse tree
*/
void enterScAttrPath(AqlParser.ScAttrPathContext ctx);
void enterScTermPath_Singular(AqlParser.ScTermPath_SingularContext ctx);
/**
* Exit a parse tree produced by {@link AqlParser#scAttrPath}.
* Exit a parse tree produced by the {@code ScTermPath_Singular}
* labeled alternative in {@link AqlParser#scTermPath}.
* @param ctx the parse tree
*/
void exitScAttrPath(AqlParser.ScAttrPathContext ctx);
void exitScTermPath_Singular(AqlParser.ScTermPath_SingularContext ctx);
/**
* Enter a parse tree produced by {@link AqlParser#schemaColimitModifySection}.
* @param ctx the parse tree
......
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/5sg/-ru88jt/AqlParser.g4 by ANTLR 4.7
// Generated from /home/fred/.boot/cache/tmp/home/fred/github/fql2/gen_src/catdata/aql/grammar/f90/-ru88jt/AqlParser.g4 by ANTLR 4.7
package catdata.aql.grammar;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
......@@ -620,13 +620,6 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitSchemaExp_OfInstance(AqlParser.SchemaExp_OfInstanceContext ctx);
/**
* Visit a parse tree produced by the {@code SchemaExp_Destination}
* labeled alternative in {@link AqlParser#schemaExp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSchemaExp_Destination(AqlParser.SchemaExp_DestinationContext ctx);
/**
* Visit a parse tree produced by the {@code SchemaExp_GetSchemaColimit}
* labeled alternative in {@link AqlParser#schemaExp}.
......@@ -2248,6 +2241,18 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitSchemaColimitQuotientSection(AqlParser.SchemaColimitQuotientSectionContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#scQuotientEqu}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitScQuotientEqu(AqlParser.ScQuotientEquContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#scQuotientFkEqu}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitScQuotientFkEqu(AqlParser.ScQuotientFkEquContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#scObsEquation}.
* @param ctx the parse tree
......@@ -2261,23 +2266,25 @@ public interface AqlParserVisitor<T> extends ParseTreeVisitor<T> {
*/
T visitScGen(AqlParser.ScGenContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#scEntityPath}.
* Visit a parse tree produced by {@link AqlParser#scGenType}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitScEntityPath(AqlParser.ScEntityPathContext ctx);
T visitScGenType(AqlParser.ScGenTypeContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#scFkPath}.
* Visit a parse tree produced by the {@code ScTermPath_Dotted}
* labeled alternative in {@link AqlParser#scTermPath}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitScFkPath(AqlParser.ScFkPathContext ctx);
T visitScTermPath_Dotted(AqlParser.ScTermPath_DottedContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#scAttrPath}.
* Visit a parse tree produced by the {@code ScTermPath_Singular}
* labeled alternative in {@link AqlParser#scTermPath}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitScAttrPath(AqlParser.ScAttrPathContext ctx);
T visitScTermPath_Singular(AqlParser.ScTermPath_SingularContext ctx);
/**
* Visit a parse tree produced by {@link AqlParser#schemaColimitModifySection}.
* @param ctx the parse tree
......
......@@ -19,9 +19,6 @@ schemaExp
| SCHEMA_OF instanceKind
# SchemaExp_OfInstance
| DST queryRef
# SchemaExp_Destination
| GET_SCHEMA schemaColimitRef
# SchemaExp_GetSchemaColimit
......
......@@ -7,57 +7,52 @@ schemaColimitRef: symbol ;
schemaColimitAssignment: SCHEMA_COLIMIT schemaColimitId EQUAL schemaColimitExp ;
schemaColimitExp
: QUOTIENT schemaRef (PLUS schemaRef)* COLON typesideRef
(LBRACE schemaColimitQuotientSection RBRACE)?
# SchemaColimitExp_Quotient
: QUOTIENT schemaRef (PLUS schemaRef)* COLON typesideRef
(LBRACE schemaColimitQuotientSection RBRACE)?
# SchemaColimitExp_Quotient
| COPRODUCT schemaRef (PLUS schemaRef)* COLON typesideRef
# SchemaColimitExp_CoProduct
| COPRODUCT schemaRef (PLUS schemaRef)* COLON typesideRef
# SchemaColimitExp_CoProduct
| MODIFY schemaColimitRef
(LBRACE schemaColimitModifySection RBRACE)?
# SchemaColimitExp_Modify
| MODIFY schemaColimitRef
(LBRACE schemaColimitModifySection RBRACE)?
# SchemaColimitExp_Modify
| WRAP schemaColimitRef mappingRef mappingRef
# SchemaColimitExp_Wrap
;
| WRAP schemaColimitRef mappingRef mappingRef
# SchemaColimitExp_Wrap
;
schemaColimitKind
: schemaColimitRef # SchemaColimitKind_Ref
: schemaColimitRef # SchemaColimitKind_Ref
| LPAREN schemaColimitExp RPAREN # SchemaColimitKind_Exp
;
schemaColimitQuotientSection
: (ENTITY_EQUATIONS (scEntityPath EQUAL scEntityPath)*)?
(PATH_EQUATIONS (scFkPath EQUAL scFkPath)*)?
(OBSERVATION_EQUATIONS scObsEquation* )?
;
scObsEquation
: FORALL scGen (COMMA scGen)* DOT scEntityPath EQUAL scEntityPath
;
scGen : symbol ;
: (ENTITY_EQUATIONS scQuotientEqu*)?
(PATH_EQUATIONS scQuotientFkEqu*)?
(OBSERVATION_EQUATIONS scObsEquation* )?
allOptions
;
scEntityPath
: schemaRef DOT schemaTermId
| schemaTermId
;
scQuotientEqu : scTermPath EQUAL scTermPath ;
scQuotientFkEqu : scTermPath EQUAL scTermPath ;
scFkPath
: schemaRef DOT schemaTermId
| schemaTermId
scObsEquation
: FORALL scGen DOT scTermPath EQUAL scTermPath
;
scAttrPath
: schemaRef DOT schemaTermId
| schemaTermId
scGen : symbol (COLON scGenType)? ;
scGenType : symbol ;
scTermPath
: schemaRef DOT schemaTermId # ScTermPath_Dotted
| schemaTermId # ScTermPath_Singular
;
schemaColimitModifySection
: (RENAME ENTITIES (scEntityPath RARROW scEntityPath)*)?
(RENAME FOREIGN_KEYS (scFkPath RARROW scFkPath)*)?
(RENAME ATTRIBUTES (scAttrPath RARROW scAttrPath)*)?
(REMOVE FOREIGN_KEYS (scFkPath RARROW scFkPath)*)?
(REMOVE ATTRIBUTES (scAttrPath RARROW scAttrPath)*)?
;
: (RENAME ENTITIES (scTermPath RARROW scTermPath)*)?
(RENAME FOREIGN_KEYS (scTermPath RARROW scTermPath)*)?
(RENAME ATTRIBUTES (scTermPath RARROW scTermPath)*)?
(REMOVE FOREIGN_KEYS (scTermPath RARROW scTermPath)*)?
(REMOVE ATTRIBUTES (scTermPath RARROW scTermPath)*)?
;
......@@ -8,10 +8,9 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
import java.util.stream.Collectors;
import com.sun.tools.sjavac.Log;
import catdata.Chc;
import catdata.Ctx;
import catdata.Pair;
......@@ -73,6 +72,21 @@ public final class RawTerm {
return ls;
}
/**
* Grab the element from the RawTerm.
* @param primary the depth into the term
* @param secondary the width to the node
* @return a String representing the value of the node. null if not present.
*/
public String byIndex(final int ...ixs) {
RawTerm term = this;
for (int ix : ixs) {
if (ix >= term.args.size()) return null;
term = term.args.get(ix);
}
return term.head;
}
private static Set<Triple<Term<Ty, En, Sym, Fk, Att, Gen, Sk>, Ctx<Var, Chc<Ty, En>>, Chc<Ty, En>>> infer_good(
RawTerm e, Chc<Ty, En> expected, Collage<Ty, En, Sym, Fk, Att, Gen, Sk> col, String pre, AqlJs<Ty, Sym> js,
Map<Var, Chc<Ty, En>> vars) {
......
......@@ -116,9 +116,31 @@ public final class Schema<Ty, En, Sym, Fk, Att> implements Semantics {
Collections.emptySet(), t.semantics, false);
}
public Schema(TypeSide<Ty, Sym> typeSide, Set<En> ens, Map<Att, Pair<En, Ty>> atts, Map<Fk, Pair<En, En>> fks,
public static <Ty,En,Sym,Fk,Att> Schema<Ty,En,Sym,Fk,Att> terminalEx(TypeSide<Ty, Sym> t) {
final TypeSide<Ty, Sym> typeSide = t;
final Set<En> ens = Collections.emptySet();
final Map<Att, Pair<En, Ty>> atts = Collections.emptyMap();
final Map<Fk, Pair<En, En>> fks = Collections.emptyMap();
final Set<Triple<Pair<Var, En>, Term<Ty, En, Sym, Fk, Att, Void, Void>, Term<Ty, En, Sym, Fk, Att, Void, Void>>>
eqs = Collections.emptySet();
@SuppressWarnings("unchecked")
final DP<Ty, En, Sym, Fk, Att, Void, Void> semantics = (DP<Ty, En, Sym, Fk, Att, Void, Void>) t.semantics;
final boolean checkJava = false;
return new Schema<>(typeSide, ens, atts, fks, eqs, semantics, checkJava);
}
public Schema(
TypeSide<Ty, Sym> typeSide,
Set<En> ens,
Map<Att, Pair<En, Ty>> atts,
Map<Fk, Pair<En, En>> fks,
Set<Triple<Pair<Var, En>, Term<Ty, En, Sym, Fk, Att, Void, Void>, Term<Ty, En, Sym, Fk, Att, Void, Void>>> eqs,
DP<Ty, En, Sym, Fk, Att, Void, Void> semantics, boolean checkJava) {
DP<Ty, En, Sym, Fk, Att, Void, Void> semantics,
boolean checkJava)
{
Util.assertNotNull(typeSide, ens, fks, atts, eqs, semantics);
this.typeSide = typeSide;
this.atts = new Ctx<>(atts);
......
......@@ -79,7 +79,15 @@ public class TypeSide<Ty, Sym> implements Semantics {
public TypeSide(Set<Ty> tys, Map<Sym, Pair<List<Ty>, Ty>> syms, Set<Triple<Ctx<Var, Ty>, Term<Ty, Void, Sym, Void, Void, Void, Void>, Term<Ty, Void, Sym, Void, Void, Void, Void>>> eqs, /*Map<Ty, String> java_tys_string, Map<Ty, String> java_parser_string, Map<Sym, String> java_fns_string,*/ AqlJs<Ty,Sym> js, DP<Ty, Void, Sym, Void, Void, Void, Void> semantics, boolean checkJava) {
public TypeSide(
Set<Ty> tys,
Map<Sym, Pair<List<Ty>, Ty>> syms,
Set<Triple<Ctx<Var, Ty>, Term<Ty, Void, Sym, Void, Void, Void, Void>, Term<Ty, Void, Sym, Void, Void, Void, Void>>> eqs,
/*Map<Ty, String> java_tys_string, Map<Ty, String> java_parser_string, Map<Sym, String> java_fns_string,*/
AqlJs<Ty,Sym> js,
DP<Ty, Void, Sym, Void, Void, Void, Void> semantics,
boolean checkJava)
{
Util.assertNotNull(tys, syms, eqs, js, semantics);
this.tys = tys;
this.syms = new Ctx<>(syms);
......@@ -225,7 +233,25 @@ public class TypeSide<Ty, Sym> implements Semantics {
}
public static TypeSide<Void,Void> terminal() {
return new TypeSide<>(new HashSet<>(), new HashMap<>(), new HashSet<>(), new AqlJs<>(new Ctx<>(), new Ctx<>(), new Ctx<>(), new Ctx<>()), DP.terminal, false);
return terminalEx();
}
public static <Ty,Sym> TypeSide<Ty,Sym> terminalEx() {
final Set<Ty> tys = new HashSet<>();
final Map<Sym, Pair<List<Ty>, Ty>> syms = new HashMap<>();
final Set<Triple<Ctx<Var, Ty>, Term<Ty, Void, Sym, Void, Void, Void, Void>, Term<Ty, Void, Sym, Void, Void, Void, Void>>>
eqs = new HashSet<>();
/* Map<Ty, String> java_tys_string, Map<Ty, String> java_parser_string, Map<Sym, String> java_fns_string,*/
final AqlJs<Ty,Sym> js = new AqlJs<>(new Ctx<>(), new Ctx<>(), new Ctx<>(), new Ctx<>());
@SuppressWarnings("unchecked")
final DP<Ty, Void, Sym, Void, Void, Void, Void>
semantics = (DP<Ty, Void, Sym, Void, Void, Void, Void>) DP.terminal;
final boolean checkJava = false;
return new TypeSide<Ty,Sym>(tys, syms, eqs, js, semantics, checkJava);
}
public final DP<Ty, Void, Sym, Void, Void, Void, Void> semantics;
......
This diff is collapsed.
......@@ -130,62 +130,38 @@ public abstract class ColimSchExp<N> extends Exp<ColimitSchema<N>> {
return RawTerm.fold(l, "_v0");
}
private String toString;
@Override
public synchronized String toString() {
if (toString != null) {
return toString;
}
toString = "";
List<String> temp = new LinkedList<>();
final StringBuilder sb = new StringBuilder();
if (!eqEn.isEmpty()) {
toString += "\tentity_equations";
for (Quad<N, En, N, En> x : eqEn) {
temp.add(x.first + "." + x.second + " = " + x.third + "." + x.fourth);
}
toString += "\n\t\t" + Util.sep(temp, "\n\t\t") + "\n";
sb.append("\tentity_equations")
.append(this.eqEn.stream()
.map(x -> x.first + "." + x.second + " = " + x.third + "." + x.fourth)
.collect(Collectors.joining("\n\t\t","\n\t\t","\n")));</