Symja - Java computer algebra library - https://github.com/axkr/symja_android_library
axkr on master
hipparchus version 2.2 (compare)
dependabot[bot] on maven
axkr on master
Bump RoaringBitmap from 0.9.30 … (compare)
dependabot[bot] on maven
Bump RoaringBitmap from 0.9.30 … (compare)
dependabot[bot] on maven
axkr on master
Bump logicng from 2.3.1 to 2.3.… (compare)
dependabot[bot] on maven
Bump logicng from 2.3.1 to 2.3.… (compare)
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/
deMorgan1
/deMorgan2
replacements are doing
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?
IExpr calcExpr = evaluator.eval("Variables(" + calc + ")");
and calc
being my formula
getVariablesArray(calcExpr);
@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
?
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();
}
@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.)
formulaEvaluator.eval("deMorganDisCon = {x_ || y_ :> !(!x && !y)}");
formulaEvaluator.eval("deMorganConDis = {x_ && y_ :> !(!x || !y)}");
Something like this? ^-^' @axkr