private IExpr mo(Node node) { String text = node.getTextContent(); if (text.length() == 1) { if (SHOW_UNICODE) { System.out.println("mo: " + text + " - " + toUnicodeString(text, "UTF-8")); } IExpr x = UNICODE_OPERATOR_MAP.get(text); if (x != null) { return x; } } return F.$s(text); }
/** * Create a pattern for pattern-matching and term rewriting * * @param symbolName * @return IPattern */ public static IPattern $p(@Nonnull final String symbolName) { // if (symbolName == null) { // return org.matheclipse.core.expression.Pattern.valueOf(null); // } return org.matheclipse.core.expression.Pattern.valueOf($s(symbolName)); }
public static IAST Head(final IExpr a) { // TODO fix this return unary($s("Head"), a); }
public static IAST SinIntegral(final IExpr a) { // TODO fix this return unary($s("SinIntegral"), a); }
public static IAST Sow(final IExpr a) { // TODO fix this return unary($s("Sow"), a); }
public static IAST Join(final IExpr a0, final IExpr a1) { // TODO return binary($s("Join"), a0, a1); }
public static IAST Count(final IExpr a0, final IExpr a1, final IExpr a2) { // TODO return ternary($s("Count"), a0, a1, a2); }
public static IAST Reverse(final IExpr a) { // TODO fix this return unary($s("Reverse"), a); }
public static void init() { // Dist[u_,v_]+Dist[w_,v_] := If[ZeroQ[u+w], 0, Dist[u+w,v]], org.matheclipse.core.reflection.system.Plus.CONST.setUpHashRule(Dist($p("u"), $p("v")), Dist($p("w"), $p("v")), If(ZeroQ(Plus( $s("u"), $s("w"))), C0, Dist(Plus($s("u"), $s("w")), $s("v"))), null); // Dist[u_,v_]-Dist[w_,v_] := If[ZeroQ[u-w], 0, Dist[u-w,v]], org.matheclipse.core.reflection.system.Plus.CONST.setUpHashRule(Dist($p("u"), $p("v")), Times(CN1, Dist($p("w"), $p("v"))), If( ZeroQ(Plus($s("u"), Times(CN1, $s("w")))), C0, Dist(Plus($s("u"), Times(CN1, $s("w"))), $s("v"))), null); // Dist[u_,v_]*w_ := Dist[w*u,v] /; w=!=-1 org.matheclipse.core.reflection.system.Times.CONST.setUpHashRule(Dist($p("u"), $p("v")), $p("w"), Dist(Times($s("w"), $s("u")), $s("v")), UnsameQ($s("w"), CN1)); } }
/** * Create a pattern for pattern-matching and term rewriting * * @param symbolName * @param def * use a default value for this pattern if necessary * @return IPattern */ public static IPattern $p(final String symbolName, boolean def) { return $p($s(symbolName), null, def); }
public static IAST ArcCsc(final IExpr a) { // TODO fix this return unary($s("ArcCsc"), a); }
public static IAST PolynomialQuotient(final IExpr a0, final IExpr a1, final IExpr a2) { // TODO return ternary($s("PolynomialQuotient"), a0, a1, a2); }
public static IAST Protect(final IExpr a) { // TODO fix this return unary($s("Protect"), a); }
/** * Create a pattern for pattern-matching and term rewriting * * @param symbolName * @return IPattern */ public static IPatternSequence $ps(final String symbolName) { if (symbolName == null) { return PatternSequence.valueOf(null); } return PatternSequence.valueOf((Symbol) $s(symbolName)); }
public static ISymbol $sDBG(final String symbolName) { ISymbol sym = $s(symbolName); // sym.setAttributes(ISymbol.CONSOLE_OUTPUT); return sym; }
/** * Create a function * * @param head * usually a String which tags the function * @return IAST * @see org.matheclipse.parser.client.IConstantHeaders */ public static IAST function(final String head) { final IAST list = ast($s(head)); return list; }
public static ISymbol $sDBG(final String symbolName) { ISymbol sym = $s(symbolName); // sym.setAttributes(ISymbol.CONSOLE_OUTPUT); return sym; }
public static IAST getAllNames() { int size = AST2Expr.FUNCTION_STRINGS.length; IASTAppendable list = F.ListAlloc(size); return list.appendArgs(0, size, i -> F.$s(AST2Expr.FUNCTION_STRINGS[i])); // for (int i = 0; i < size; i++) { // list.append(F.$s(AST2Expr.FUNCTION_STRINGS[i])); // } // return list; } }
/** * Create a pattern for pattern-matching and term rewriting * * @param symbolName * the name of the pattrn symbol * @return IPattern */ public static IPatternSequence $ps(final String symbolName) { return PatternSequence.valueOf($s(symbolName), false); }
/** * Create a pattern for pattern-matching and term rewriting * * @param symbolName * @return IPattern */ public static IPattern $p(final String symbolName) { if (symbolName == null) { return Pattern.valueOf(null); } return Pattern.valueOf((Symbol) $s(symbolName)); }