If your ASTs have a small number of conditions, then you can use the following naive approach.
1) Convert your ASTs to a CSOP (Canonical Sum Of Products) expression.
From your example, lets convert each condition to a boolean variable and express $A$ and $B$ as boolean expressions in the following variables
$p: (x ==1)$
$q: (y==5)$
$r: (b == 2)$
$s: (c == d)$
Now
$ A: \space p \cdot (r + s)$
$B: p \cdot q \cdot (r + s)$
Normalising $A$ and $B$ yields
$A: p \cdot \lnot q \cdot r \cdot \lnot s +
p \cdot \lnot q \cdot r \cdot s +
p \cdot q \cdot r \cdot \lnot s +
p \cdot q \cdot r \cdot s +
p \cdot \lnot q \cdot \lnot r \cdot s +
p \cdot q \cdot \lnot r \cdot s
$
$B: p \cdot q \cdot r \cdot \lnot s +
p \cdot q \cdot \lnot r \cdot s +
p \cdot q \cdot r \cdot s
$
2) Check if $ B \subseteq A$. In the above example it is true. This implies $B$ is stricter than $A$. If thought logically, all conditions in $B$ are fulfilled by $A$, but $A$ also satisfies other conditions not in $B$.
Hence, $B$ is stricter compared to $A$.
Note: Expanding boolean expressions to normal forms requires exponential space. The algorithm might need some optimisation tweaks for larger expressions.