Questions tagged [term-rewriting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
19 votes
1 answer

When did this global rules change happen in Mathematica? Is this change documented?

In this Wolfram talk video titled "Professor Richard J. Gaylord's Wolfram Language Fundamentals Part Two" he shows at time 36:45 the following Where there are two definitions for ...
Nasser's user avatar
  • 137k
2 votes
1 answer

How to introduce a symbol for the derivative as a symbol with a point on top?

I am making images in Mma for an article. In a FrameLabel I need to show a text containing a derivative in form of the letter X with a point on top: I found a special button in Palette "Writing ...
Alexei Boulbitch's user avatar
4 votes
1 answer

Making a rule that only applies when the expression is NOT an argument?

I know we can make rules of the kind: magic/:f_[x___,magic[a_],y___]:=f[x,arg[a],y] This will replace magic[a] by ...
user3257842's user avatar
1 vote
0 answers

If it possible to define a "function" such that the normal form will have the arguments in order? [closed]

I'm looking for something that acts like this. How could ord be defined for 2 arguments? What about n? Since Mathematica is a term-rewriting system it should be possible, but all my attempts were ...
user3257842's user avatar
0 votes
3 answers

Partial evaluation of a function [duplicate]

In the spirit of a previous question, this is a self-assigned exercise in order to understand how we can control expression evaluation with Mathematica. So, given the following function definition: <...
Sylvain Leroux's user avatar
3 votes
7 answers

Obtaining the terms of a summation alongside the result

I have a Sum expression: s := Sum[2x,{x,0,3}] As an exercise to explore the rewriting capabilities of the Wolfram Language, I ...
Sylvain Leroux's user avatar
0 votes
0 answers

how to force TransformationFunctions

I have this function: F[z_, y_, θ_] = Sqrt[3]/(2*π)*w^2/z^2 * Exp[-w^2*(θ^2/z - 3*y*θ/z^2 + 3*y^2/z^3)] I want to calculate ...
Andrea Mazzolari's user avatar
2 votes
1 answer

Converting an expression with strings to an association

I have an expression which contains a bunch of strings and some complex valued numeric factors in front. A couple of summands might look like this: ...
Martin Ueding's user avatar
32 votes
2 answers

Why did the Mathematica Language choose term rewriting instead of the Lambda Calculus as its basis?

Now we can see that Church was associated with the Simply Typed Lambda Calculus. Indeed, it seems he explained the Simply Typed Lambda Calculus in order to reduce misunderstanding about the Lambda ...
hawkeye's user avatar
  • 439
8 votes
2 answers

Collect/Factor a fraction

Is there a way to tell Mathematica to factor things only containing a specific combination of a fraction, example: $$\tag{1}f = \frac{a+m\cdot a+b+n\cdot b+c+k\cdot c+d+e}{ab}$$ Is there a way to ...
Physics_maths's user avatar
0 votes
1 answer

Collection prefactors of arbitrary functions

I generated a very lengthy expression in Mathematica which can be written in the form $f(x,y,z)\log(x-y+z) + g(x,y,z)\log(x+y+z) + h(x,y)\log(x+y-z)$ etc. I would like to collect the functions $f(x,y,...
Funzies's user avatar
  • 391
2 votes
0 answers

Write trigs in terms of Cosine only

I have a long expression having terms that go in squares like Sin[x]^2 and Sin[x/2]^2 and so on... I would like to rewrite my ...
Physics_maths's user avatar
3 votes
2 answers

Factor a specific sub-polynomial?

Consider the following example for a polynomial in several variables: ...
Kagaratsch's user avatar
  • 11.9k
0 votes
0 answers

Is there a function equivalent to rewrite function in Sympy

Sympy provide rewrite function to rewrite expression in terms of other functions. ...
Kattern's user avatar
  • 2,541