List の remove() 関数と,Map の delete() 関数を追加.
1 parent e034592 commit 1a584926dc7abda4e2ff3c9c66b14ae25d1e0c58
Naoya Nitta authored on 5 Dec 2023
Showing 1 changed file
View
6
AlgebraicDataflowArchitectureModel/src/models/dataConstraintModel/DataConstraintModel.java
public static final Symbol div = new Symbol(Parser.DIV, 2, Symbol.Type.INFIX);
public static final Symbol minus = new Symbol(Parser.MINUS, 1);
public static final Symbol cons = new Symbol("cons", 2, Symbol.Type.PREFIX, "($x,$y)->$x.add(0, $y)", Symbol.Type.LAMBDA_WITH_SIDE_EFFECT, new int[] {1, 0});
public static final Symbol append = new Symbol("append", 2, Symbol.Type.PREFIX, "add", Symbol.Type.METHOD_WITH_SIDE_EFFECT);
public static final Symbol remove = new Symbol("remove", 2, Symbol.Type.PREFIX, "remove", Symbol.Type.METHOD_WITH_SIDE_EFFECT);
public static final Symbol head = new Symbol("head", 1, Symbol.Type.PREFIX, "($x)->$x.get(0)", Symbol.Type.LAMBDA);
public static final Symbol tail = new Symbol("tail", 1, Symbol.Type.PREFIX, "($x)->$x.subList(1, $x.size())", Symbol.Type.LAMBDA);
public static final Symbol length = new Symbol("length", 1, Symbol.Type.PREFIX, "($x)->$x.size()", Symbol.Type.LAMBDA);
public static final Symbol get = new Symbol("get", 2, Symbol.Type.PREFIX, "get", Symbol.Type.METHOD);
public static final Symbol snd = new Symbol("snd", 1, Symbol.Type.PREFIX, "getValue", Symbol.Type.METHOD);
public static final Symbol left = new Symbol("left", 1, Symbol.Type.PREFIX, "getLeft", Symbol.Type.METHOD);
public static final Symbol right = new Symbol("right", 1, Symbol.Type.PREFIX, "getRight", Symbol.Type.METHOD);
public static final Symbol insert = new Symbol("insert", 3, Symbol.Type.PREFIX, "put", Symbol.Type.METHOD_WITH_SIDE_EFFECT);
public static final Symbol delete = new Symbol("delete", 2, Symbol.Type.PREFIX, "remove", Symbol.Type.METHOD_WITH_SIDE_EFFECT);
public static final Symbol lookup = new Symbol("lookup", 2, Symbol.Type.PREFIX, new Symbol.IImplGenerator() {
final int count[] = {0};
@Override
public String generate(Type type, String[] childrenImpl, String[] childrenSideEffects, String[] sideEffect) {
mod.setSignature(new Type[] {typeInt, null, null});
cons.setInverses(new Symbol[] {head, tail});
cons.setSignature(new Type[] {typeList, null, typeList});
append.setSignature(new Type[] {typeList, typeList, null});
remove.setSignature(new Type[] {typeList, typeList, typeInt});
head.setSignature(new Type[] {null, typeList});
tail.setSignature(new Type[] {typeList, typeList});
contains.setSignature(new Type[] {typeBoolean, typeList, null});
length.setSignature(new Type[] {typeInt, null});
fst.setInverses(new Symbol[] {new LambdaAbstraction(new Variable("x"), new Term(tuple, new Expression[] {new Variable("x"), new Variable("y")}))});
snd.setSignature(new Type[] {null, typeTuple});
snd.setInverses(new Symbol[] {new LambdaAbstraction(new Variable("y"), new Term(tuple, new Expression[] {new Variable("x"), new Variable("y")}))});
insert.setSignature(new Type[] {typeMap, typeMap, null, null});
delete.setSignature(new Type[] {typeMap, typeMap, null});
lookup.setSignature(new Type[] {null, typeMap, null});
addMember.setSignature(new Type[] {typeJson, typeJson, typeString, null});
dot.setSignature(new Type[] {null, typeJson, typeString});
dotParam.setSignature(new Type[] {null, null, null});
addSymbol(minus);
addSymbol(mod);
addSymbol(cons);
addSymbol(append);
addSymbol(remove);
addSymbol(head);
addSymbol(tail);
addSymbol(length);
addSymbol(contains);
addSymbol(tuple);
addSymbol(fst);
addSymbol(snd);
addSymbol(insert);
addSymbol(delete);
addSymbol(lookup);
addSymbol(addMember);
addSymbol(dot);
addSymbol(dotParam);