# \[ANN\] Reduce.jl : Symbolic CAS parser-interface

**URL:** <https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452>\
**Category:** Community\
**Tags:** package, announcement, metaprogramming\
**Created:** [June 5, 2018, 6:43pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452 "2018-06-05T18:43:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [June 5, 2018, 6:43pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/1 "2018-06-05T18:43:56Z")

</div>

![logo](https://global.discourse-cdn.com/julialang/original/3X/8/1/81ead773062b2b5f5cae79a79e92d89d79159a61.png)

[REDUCE](http://www.reduce-algebra.com/) is a portable general-purpose computer algebra system. This package enables users of Julia to use this programmable CAS inside Julia with methods that automatically parse queries and their output.

> **[GitHub - chakravala/Reduce.jl: Symbolic parser for Julia language term...](https://github.com/chakravala/Reduce.jl)**
>
> Symbolic parser for Julia language term rewriting using REDUCE algebra - GitHub - chakravala/Reduce.jl: Symbolic parser for Julia language term rewriting using REDUCE algebra

It currently supports both 0.6 and 0.7 version of Julia. See README and [docs](https://chakravala.github.io/Reduce.jl/latest) for examples.

At this point in the development of this module, there should be enough documentation with examples available for users to see what they can do with it. The way it currently works is by piping the IO from Julia with the upstream reduce binaries provided on SourceForge. In time, it will be possible to port these methods into native Julia or to make upstream modifications that enable the use `C` interfaces, with other planned optimizations for the Julia-Reduce parser performance.

It will be interesting to see what kind of use cases that users will come up with. Due to the large amount of generated code produced by this module, all generated code has not been individually tested for special input or output scenarios. However, the generalized nature of the parser-generator has been well-tested for robustness, even though each individual generated method is not tested yet.

With this package, it is easily possible to extend the integration of Reduce with the Julia language, by use of the `parsegen` method. Regular users don’t need to use it, but for developers who are interested in extending Reduce: it is worth knowing that it is very simple to create more specialized call methods. An example of how this can be done is the `ReduceLinAlg` package, which uses `Reduce` and provides an additional set of linear algebra related methods. The [JuliaReducePkg](https://github.com/JuliaReducePkg) organization has been created in order to organize further extensions and additional packages created with the `Reduce` parser and its features.

This discourse thread, the gitter page, and the issues and pull-requests can be used to provide feedback.

> **[REDUCE](https://sourceforge.net/projects/reduce-algebra/)**
>
> Download REDUCE for free. A Portable General-Purpose Computer Algebra System. REDUCE is an interactive system for general algebraic computations of interest to mathematicians, scientists and engineers. It can be used interactively for simple...

Issues with the upstream REDUCE binaries can be resolved with the collaborators on SourceForge.

If you come up with some interesting use-cases for this, you are free to communicate them here too.

---

<div class="post-metadata">

**Author:** ![louisponet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/louisponet/32/2070_2.png) [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Post date:** [June 5, 2018, 7:46pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/2 "2018-06-05T19:46:35Z")

</div>

I get a curl error due to some certification issues, when I try to build `Reduce`. I assume thats an issue with the binaries? Any easy fixes?

```julia
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or thename might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

```

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [June 5, 2018, 7:48pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/3 "2018-06-05T19:48:15Z")

</div>

> [@louisponet](#):
>
> I get a curl error due to some certification issues, when I try to build `Reduce` . I assume thats an issue with the binaries? Any easy fixes?

Could be, or your local certificates are out of date (update?). If you have a lot of trouble with the certificate, you can technically install the program manually too, in multiple ways.

---

<div class="post-metadata">

**Author:** ![louisponet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/louisponet/32/2070_2.png) [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Post date:** [June 5, 2018, 8:35pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/4 "2018-06-05T20:35:12Z")

</div>

seems to be because the `curl` used by `julia` is somehow not the one in my PATH… Rather an anaconda one… Weird, but I managed to download the dmg.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [June 5, 2018, 8:37pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/5 "2018-06-05T20:37:45Z")

</div>

> [@louisponet](#):
>
> managed to download the dmg

the build script for OSX basically runs these commands here

> <https://github.com/chakravala/Reduce.jl/blob/master/deps/build.jl#L64-L70>

so just copy the `csl` folder from dmg into the `deps/csl` folder and you are set

---

<div class="post-metadata">

**Author:** ![louisponet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/louisponet/32/2070_2.png) [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Post date:** [June 5, 2018, 8:38pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/6 "2018-06-05T20:38:21Z")

</div>

Yea I just manually downloaded it, commented out the `download` line and it worked 🙂 thanks!

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [June 5, 2018, 10:28pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/7 "2018-06-05T22:28:46Z")

</div>

Is defining mathematical functions on symbols and expressions not type piracy?

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [June 5, 2018, 10:38pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/8 "2018-06-05T22:38:08Z")

</div>

> [@Mason](#):
>
> Is defining mathematical functions on symbols and expressions not type piracy?

Yes, it is, but only if those methods are being “pirated.” However, in `Reduce`, the methods contained in the `Reduce.Algebra` module are not the same ones that are in `Base`. They are their own methods, so they are not doing type-piracy and do not modify the global behavior of the `Base` methods. For example `Algebra.:+` is not the same method as `Base.:+`.

```Julia
julia> Algebra.:+ == Base.:+
false

```

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [August 10, 2018, 6:33pm UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/9 "2018-08-10T18:33:52Z")

</div>

The first major version v1.0.0 of [Reduce.jl](https://github.com/chakravala/Reduce.jl) is now released and compatible with Julia 1.0 and 0.7

Now that the 1.0 transition is complete, the next planned minor update for Reduce.jl will be focused on making the parsing faster with an extensive `IOBuffer` redesign of the parser-generator. I already have an outline and several planned approaches for redesign; however since I am working on this package on my free time alongside other priorities, I can’t provide a specific date for the next update yet. Stay tuned for more and if there are any issues a patch update will be released as soon as it is needed / resolved.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 4, 2019, 2:04am UTC](https://discourse.julialang.org/t/ann-reduce-jl-symbolic-cas-parser-interface/11452/10 "2019-10-04T02:04:05Z")

</div>

The package is now updated to v1.2.3 with newest revision REDUCE binaries `snapshot_2019-09-15`.

One interesting side note is the [download history](https://sourceforge.net/projects/reduce-algebra/files/) of the previously used binaries `snapshot_2018-04-06`:

 ![REDUCE-2018-04-06-w](https://global.discourse-cdn.com/julialang/original/3X/0/3/03696f1f0660383bdf80a1eb1523302ebb02efde.png)

This snapshot used by the Julia `Reduce` package was downloaded 6550 times, which is fairly active.

Other snapshots of REDUCE were not so actively downloaded, giving insight into the Julia user base.

 ![REDUCE-2018-08-08-w](https://global.discourse-cdn.com/julialang/original/3X/e/3/e3f2cbcd3229a3086860c603941f93e370218dd0.png)

In the other graph above, the `snapshot_2018-08-08` was not used by the Julia community and has 900 downloads. From this data, it is clear that Julia users are a significant portion of REDUCE users.

Most of the downloads of the sustained `snapshot_2018-04-06` up until now were due to Julia users.
