Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 12 07:16

    dependabot[bot] on maven

    (compare)

  • Aug 12 07:16
    axkr closed #571
  • Aug 12 07:16

    axkr on master

    Bump undertow-core from 2.2.18.… (compare)

  • Aug 12 07:16

    dependabot[bot] on maven

    (compare)

  • Aug 12 07:16

    axkr on master

    Bump undertow-servlet from 2.2.… (compare)

  • Aug 12 07:16
    axkr closed #570
  • Aug 12 04:14
    gitpod-io[bot] commented #571
  • Aug 12 04:14
    dependabot[bot] labeled #571
  • Aug 12 04:14
    dependabot[bot] labeled #571
  • Aug 12 04:14
    dependabot[bot] opened #571
  • Aug 12 04:14

    dependabot[bot] on maven

    Bump undertow-core in /symja_an… (compare)

  • Aug 12 04:13
    gitpod-io[bot] commented #570
  • Aug 12 04:13
    dependabot[bot] labeled #570
  • Aug 12 04:13
    dependabot[bot] labeled #570
  • Aug 12 04:13
    dependabot[bot] opened #570
  • Aug 12 04:13

    dependabot[bot] on maven

    Bump undertow-servlet in /symja… (compare)

  • Aug 10 17:58

    axkr on master

    hipparchus version 2.2 (compare)

  • Aug 05 05:54

    dependabot[bot] on maven

    (compare)

  • Aug 05 05:54

    axkr on master

    Bump RoaringBitmap from 0.9.30 … (compare)

  • Aug 05 05:54
    axkr closed #569
Axel Kramer
@axkr
but the arguments of the function should be symbolic.
breandan
@breandan
Hi Axel, I've been reading about SymJa. It's an amazing piece of work! I'm particularly impressed by the effort you've put into usability. Been reading through the source code and I'm not sure how it all fits together yet, but I was curious if you currently support or plan to implement Knuth–Bendix completion for general purpose term rewriting? Is there some documentation on how the different CAS's (e.g. JAS, Rubi) fit together? Can you describe your long-term goals for the project, i.e. do you plan to focus on the user-facing application and notebook support, or do you see Symja as becoming more of a library like Sympy? Thanks for your hard work on this project!
Axel Kramer
@axkr
@breandan Yes general purpose term rewriting is the goal. JAS is supported by converting from Symja IExpr to JAS and backward:
https://github.com/axkr/symja_android_library/blob/master/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/convert/JASConvert.java.
The conversion of Rubi (Mathematica pattern matching rules) is described in this wiki page:
https://github.com/axkr/symja_android_library/wiki/Porting-Rubi-Integration-rules-to-Symja.
Symja is used currently in the Android and Apple Store NCalc programs by github user @tranleduy2000.
(Very) long term goal is to use Symja as a programming language (similar to Mathematica packages) and providing a JSON API interface (with NLP functions in the future?):
https://github.com/axkr/symja_android_library/wiki/API
Евгений Буйволов
@ereborDeveloper
Hello! Did you reduce Config.EXPLICIT_TIMES_OPERATOR? I can't use it anymore. How to enable times operator?
Axel Kramer
@axkr
@ereborDeveloper please use FEConfig.EXPLICIT_TIMES_OPERATOR
The project is now splitted in more maven submodules:
<module>matheclipse-external</module> <module>matheclipse-frontend</module> <module>matheclipse-core</module> <module>matheclipse-api</module> <module>matheclipse-io</module>
Евгений Буйволов
@ereborDeveloper
Thanks! Found it in unit tests. How should I properly listen for change log? Instead of reading commits I mean
Axel Kramer
@axkr
A short summary of changes can be found in the release notes:
Евгений Буйволов
@ereborDeveloper
Ahh! Thanks! Very helpful
TiMauzi
@TiMauzi
@axkr Hello, I just found the Symja project while looking for a Java CAS. Did you happen to publish any papers concerning your work on this library? Would be very helpful, since I am working on a thesis at the moment! Thank you in advance! :)
Axel Kramer
@axkr
@TiMauzi No there is no paper.
There is the tutorial with the available functions in markdown: https://github.com/axkr/symja_android_library/tree/master/symja_android_library/doc
A feature "highlight" is the port of the RUBI integration engine: https://github.com/axkr/symja_android_library/wiki/Porting-Rubi-Integration-rules-to-Symja
Axel Kramer
@axkr
Another is the "partial" Wolfram language package support: https://github.com/axkr/symja_android_library/wiki/Context
The Compile function https://github.com/axkr/symja_android_library/blob/master/symja_android_library/doc/functions/Compile.md will be independent from the JDK in next version and will be realized with the Janino compiler: http://janino-compiler.github.io/janino/
TiMauzi
@TiMauzi
@axkr Too bad there is no paper... Thank you nevetheless for the information! :)
TiMauzi
@TiMauzi
@axkr Different question... does Symja have a method to get all literals within an IExpr object? E.g. if I have "a || b && c || c", is there a function that returns "[a, b, c, c]"?
TiMauzi
@TiMauzi
@axkr Awesome, thank you!
TiMauzi
@TiMauzi
@axkr And is there a method to invert a logical expression with De Morgan's Laws? Something like "a || b" => "!(!a && !b)"?
TiMauzi
@TiMauzi
Something like "use only '&&' and '!' but no '||'"
TiMauzi
@TiMauzi

Nice, I think I managed already:

deMorgan1 = {x_ || y_ :> !(!x && !y)}
deMorgan2 = {x_ && y_ :> !(!x || !y)}
ReplaceRepeated(fox || rabbit || chicken, deMorgan1)

... leads to: ¬(¬fox∧¬rabbit∧¬chicken), perfect :)

Axel Kramer
@axkr
@TiMauzi I'm not sure what you want to get exactly, but BooleanConvert may also be an option?
TiMauzi
@TiMauzi
No, this is not what I want, since "a || b || c" would always stay the same with BooleanConvert, while I want it to become "!(!a && !b && !c)".
I want to write a formula with only "&&"s or only "||"s, and I think that's what my deMorgan1/deMorgan2 replacements are doing
TiMauzi
@TiMauzi

The BooleanVariables() function use this internally https://github.com/axkr/symja_android_library/blob/master/symja_android_library/doc/functions/BooleanVariables.md

@axkr Is there a way of outputting the list/set created by BooleanVariables() or Variables() to a Java list or Java array?

Without doing some usual pattern matching, of course :)
Axel Kramer
@axkr
@TiMauzi something like this?
private static List<IExpr> booleanVariables(final IExpr expr) {
      VariablesSet eVar = new VariablesSet();
      eVar.addBooleanVarList(expr);
      return eVar.getArrayList(); 
}
TiMauzi
@TiMauzi
I did it the following way now:
private static String[] getVariablesArray(IExpr variables) throws MathException, StackOverflowError, OutOfMemoryError {
    return variables.toString()
            .replaceAll("\\{", "")
            .replaceAll("}", "")
            .replaceAll(" ", "")
            .split(",");
}
With IExpr calcExpr = evaluator.eval("Variables(" + calc + ")"); and calc being my formula
And then getVariablesArray(calcExpr);
Since I need the string representation anyway, I think the effort is similar, no?
Axel Kramer
@axkr
If you use regex it might be slower:
TiMauzi
@TiMauzi
Good to know, thanks for the hint!
I'll try your approach later, then :)
TiMauzi
@TiMauzi

@axkr In https://github.com/axkr/symja_android_library/blob/d1e78f694be9b7b0bea4abbacbd924c8512adc38/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/expression/F.java#L3907 there is the following part of the code:

        String autoload = ".\\Autoload";
        if (FEConfig.PARSER_USE_LOWERCASE_SYMBOLS) {
          autoload = ".\\AutoloadSymja";
        }
        File sourceLocation = new File(autoload);

Symja creates a file here. Since I'm writing an Elasticsearch plugin, creating files doesn't seem to be allowed. Is there a way of using Symja without addtional files being implicitly created by ExprEvaluator?

Axel Kramer
@axkr
@TiMauzi can you please try something like this for automatically loading init scripts:
Axel Kramer
@axkr
try {
          String autoload = ".\\Autoload";
          if (FEConfig.PARSER_USE_LOWERCASE_SYMBOLS) {
            autoload = ".\\AutoloadSymja";
          }
          File sourceLocation = new File(autoload);
          final String[] files = sourceLocation.list();
          if (files != null) {
            for (int i = 0; i < files.length; i++) {
              if (files[i].endsWith(".m")) {
                File sourceFile = new File(sourceLocation, files[i]);
                FileFunctions.Get.loadPackage(EvalEngine.get(), sourceFile);
              }
            }
          }
        } catch (java.security.AccessControlException acex) {
          // no read access for current user
          acex.printStackTrace();
        } catch (RuntimeException ex) {
          ex.printStackTrace();
        }
TiMauzi
@TiMauzi

@axkr Following output if I place this test right in front of the part of my plugin that crashes when executed:

[2021-05-14T00:21:32,244][WARN ][stderr                   ] [TIM] java.security.AccessControlException: access denied ("java.io.FilePermission" ".\AutoloadSymja" "read")
[2021-05-14T00:21:32,245][WARN ][stderr                   ] [TIM]       at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
[2021-05-14T00:21:32,246][WARN ][stderr                   ] [TIM]       at java.base/java.security.AccessController.checkPermission(AccessController.java:1036)
[2021-05-14T00:21:32,246][WARN ][stderr                   ] [TIM]       at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:408)
[2021-05-14T00:21:32,246][WARN ][stderr                   ] [TIM]       at java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:747)
[2021-05-14T00:21:32,247][WARN ][stderr                   ] [TIM]       at java.base/java.io.File.list(File.java:1131)
[2021-05-14T00:21:32,247][WARN ][stderr                   ] [TIM]       at org.elasticsearch.index.search.CommutingQuantumScorer.score(CommutingQuantumScorer.java:96)
...

(The last method before I skipped the rest is the method I placed the test in.)

TiMauzi
@TiMauzi
I found out that Elasticsearch doesn't want people to have any FilePermission. That's why I asked if there is any way to not letting Symja create some file
Axel Kramer
@axkr
@TiMauzi If you don't need any scripts, do you need an option to simply skip the autoload part?
TiMauzi
@TiMauzi
What kind of "scripts" do you mean?
formulaEvaluator.eval("deMorganDisCon = {x_ || y_ :> !(!x && !y)}");
formulaEvaluator.eval("deMorganConDis = {x_ && y_ :> !(!x || !y)}");
Something like this? ^-^' @axkr
If you mean this, then it might hurt a bit but I might be able to solve it in another way.