For a special notation I would like to get the help of Mathematica to expand complex expressions through a set of Notation rules. However since this tasks involves applying the notation recursively using the Notation package is out of question. To explain my problem lets look at the following set of rules We first have a function called cut which resembles an inequality defining cutting a 3D space into an interior and an exterior region, whereas the cut plane itself is member of the interior.
$cut[miller\_,c\_]:=miller.\{x,y,z\}+c \ge 0$
another function pcut implements a similiar function but the members of the cutplane are member of the exterior
$cut[miller\_,c\_]:=miller.\{x,y,z\}+c > 0$
with $miller$ being the miller indices of the plane described by a list $\{h,k,l\}$ and $c$ the distance of the plane from the origin.
There are now different rules transforming these junctions like
$-cut[miller,c]\Leftrightarrow cut[-miller,-c]$
$\dagger cut[miller,c]\Leftrightarrow cut[-miller,c]$
$cut[miller,c] \cdot s\Leftrightarrow cut[miller,c\times s]$
$cut[miller,c] / s\Leftrightarrow cut[miller,c/s]$
These rules are now described by the following short hand notations
$x_1\Leftrightarrow cut[\{-1,0,0\},1]$
$x_0\Leftrightarrow -x_1\cdot 0$
$x_2\Leftrightarrow -x_1/2$
$z_1\Leftrightarrow cut[\{0,0,-1\},1]$
and so on.
This syntax enables now more complex notations where even subconditions can be applied like e.g.
$z_0(-y_0)$
which means that the face of the volume $z_0\Leftrightarrow z\ge 0$ given by $z=0$ is restricted to $-y_0\Leftrightarrow y\le 0$ which finally results in the point $\{0,0,0\}$. More details about this syntax and the application of it can be found in "Exact direct-space asymmetric units for the 230 crystallographic space groups".
Now to my problem. If I try to invoke the notation package e.g. by doing the following:
$Notation[-cut[\{h\_,k\_,l\_\},c\_\}]\Leftrightarrow cut[\{-h\_,-k\_,-l\_\},-c\_]$
$Notation[\dagger cut[\{h\_,k\_,l\_\},c\_\}]\Leftrightarrow cut[\{-h\_,-k\_,-l\_\},c\_]$
and then
$Notation[x_1 \Leftrightarrow cut[\{-1,0,0\},1]]$
$Notation[x_0 \Leftrightarrow -cut[\{-1,0,0\},1]\cdot 0]$
this notation does not work recursively as one can quickly see by evaluating
$x_0$
which yields
$cut[\{1,0,0\},-1]\cdot 0$
which shows that Notation does not resolve such symbols recursively.
I noticed from other posts that MakeBoxes may do the trick and I'm not really happy how Notation is implemented. However I'm lost in implementing MakeBoxes correctly to implement above mentioned syntax correctly. Any help?
Notation
ofMakeBoxes
are really meant for, so I addressed your specific issues in a different way. You mention additional "subconditions," but I don't think they are part of the actual question you're asking, so I didn't address their implementation. $\endgroup$ – Jens May 17 '15 at 19:03