I've been attempting this problem for a good while now, and I was wondering if somebody could help me figure this one out. I am currently attempting to write a program that tests $p(B|G, D)$ and right now I am developing a table of all of the parent probabilities given that their children are either true or false.
For example: I am trying to calculate now $p(A\mid D, E)$. I know that
$$p(A\mid D) = \frac{p(D\mid A)\cdot p(A)}{ p(D\mid A)\cdot p(A) + p(D\mid !A)\cdot p(!A) }$$
and I have calculated $p(A|E)$ already as well. My question is how do I now calculate $p(A|D, E)$, $p(A|D, !E)$, etc?

Same principle. $$\def\P{\operatorname{\sf P}}\P({A\mid D,E})=\dfrac{\P({A})\P({D\mid A})\P({E\mid A})}{\P({A})\P({D\mid A})\P({E\mid A})+\P({!A})\P({D\mid !A})\P({E\mid !A})}$$