
\unprotect

\setupmathmatrix
  [\c!distance=1em,
   \c!left=,
   \c!right=,
   \c!align=middle]

\def\dosetmatrixcolumn#1%
  {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfil
   \letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfil
   \doif{#1}\v!left  {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\relax 
                      \letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfil}%
   \doif{#1}\v!right {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfil 
                      \letvalue{\??eq:\v!right:\number\eqaligncolumn}\relax }%
   \doif{#1}\v!middle{\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfil
                      \letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfil}}

\def\buildmathmatrix
  {\scratchtoks\emptytoks
   \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}%
   \dorecurse{\numexpr\scratchcounter-\plusone\relax}
        {\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb}}}%
   \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc }}}

\def\preparemathmatrix
  {\!!toksa{\strut
            \firstineqalign\leftofeqalign \span \textineqalign{##}\rightofeqalign }%
   \!!toksb{&\hskip\mathmatrixparameter\c!distance  
             \nextineqalign\leftofeqalign \span \textineqalign{##}\rightofeqalign }%
   \!!toksc{&&\hskip\mathmatrixparameter\c!distance 
              \leftofeqalign \span \textineqalign{##}\rightofeqalign }%
   \buildmathmatrix
   \halign \@EA \bgroup\the\scratchtoks \crcr}


\def\dostartmathmatrix[#1][#2]%
  {\begingroup
   \edef\currentmathmatrix{#1}%
   \doifassignmentelse{#2}{\setupmathmatrix[#1][#2]}\donothing
   \null
   \mathmatrixparameter\c!left
   \vcenter\bgroup
   \pushmacro\domatrixNC
   \let\endmath\relax
   \def\NC{\domatrixNC}%
   \def\MC{\domatrixNC\ifmmode\else$\def\endmath{$}\fi}%
   \global\let\domatrixNC\dodomatrixNC
   \def\NR{\endmath\global\let\domatrixNC\dodomatrixNC\crcr}%
   \normalbaselines
   \mathsurround\zeropoint
   \everycr\emptytoks
   \tabskip\zeropoint
   \eqaligncolumn\zeropoint
   \processcommacommand[\mathmatrixparameter\c!align]{\advance\eqaligncolumn\plusone\dosetmatrixcolumn}%
   \scratchcounter=\ifnum\eqaligncolumn>\scratchcounter \eqaligncolumn \else \plusone \fi
   \global\eqaligncolumn\plusone
   \preparemathmatrix }

\protect

\starttext
\startformula
  \startmatrix 
   \NC a + x \NC = \NC a + d \NR
   \NC y     \NC = \NC d     \NR
  \stopmatrix
\stopformula

to give me
\startformula
  \startmatrix [distance=3pt,align={right,left}]
   \NC a + x \NC = a + d \NR
   \NC y \NC = d     \NR
  \stopmatrix
\stopformula

and left and rightside:
\startformula
  \startmatrix [left=\left(,right=\right)]
   \NC a + x \NR
   \NC y    \NR
  \stopmatrix
\stopformula


This is a contrived example. The actual equation that I want to type 
is

\startformula
   \text{Let }{\cal R} = \bigcup_{P_{X_1},P_{X_2}} \left\{
   (R_1, R_2) :
   \startmatrix[distance=0.1em,align={left,right}]
     \NC \hfill R_1       \NC < I(X_1 ; Y \mid X_2) \hfill \NR
     \NC \hfill R_2       \NC < I(X_2 ; Y \mid X_1) \hfill \NR
     \NC \hfill R_1 + R_2 \NC < I(X_1 ; Y) \hfill      \NR
   \stopmatrix\right\}
\stopformula


\startformula
   \text{Let }{\cal R} = \bigcup_{P_{X_1},P_{X_2}} \left\{
   (R_1, R_2) :
   \startmatrix[distance=1em,align={left,right}]
     \NC R_1       \NC < I(X_1 ; Y \mid X_2)      \NC R_1       \NR
     \NC \hfill Q_2       \NC < I(X_2 ; Y \mid X_1)      \NC R_2       \NR
     \NC R_1 + R_2 \NC < I(X_1 ; Y)               \NC R_1 + R_2 \NR
   \stopmatrix\right\}
\stopformula

\stoptext