Pattern matching - new user question



On 10/2/09, Nathaniel Virgo <nathanielvirgo at gmail.com> wrote:

> Actually, on second thoughts, my workaround isn't very helpful since it
> applies Bayes' rule exactly once to _every_ subexpression of the form (a|b
> and c), whereas to simplify a formula you often want to apply it to just
> one of them.  So I really do need a way to apply the rule exactly once - and
> there also needs to be a way to specify which match it should be applied
> to.

Well, maybe you can use substitution then, something like:

 foo : (a | b and c);
 bar : <big expression involving foo and other stuff>;
 subst (foo = bayes (foo), bar);


best

Robert Dodier