user26902: I'm looking for a CQL query that will return all positions with the below pawn structure for both White and Black
 [FEN "8/pp3ppp/4p3/8/3P4/8/PP3PPP/8 w - - 0 1"]


user26902: All right, so I found the following query for the pawn structure in the diagram above:
(match  ;query for IQP white 
      (position 
         :and (
            (position Pa2 Pb2 Pd4 Pf2 Pg2 Ph2 pa7 pb7 pe6 pf7 pg7 ph7)
            (position
            :piececount P[c2-7,e2-7] 0
            :piececount p[c2-7,d2-7] 0 )
         )
      )
)

For black though, I wanted to search for any IQP position, so I used this query:
    (match ;query for IQP black
      (position
        :and (
          (position pd5)
          (position
            :piececount P[a2-7] 1
            :piececount P[b2-7] 1
            :piececount P[c2-7] 0
            :piececount P[d2-7] 0
            :piececount P[e2-7] 1
            :piececount P[f2-7] 1
            :piececount P[g2-7] 1
            :piececount P[h2-7] 1

            :piececount p[a2-7] 1 
            :piececount p[b2-7] 1 
            :piececount p[c2-7] 0 
            :piececount p[d2-7] 1 
            :piececount p[e2-7] 0 
            :piececount p[f2-7] 1 
            :piececount p[g2-7] 1 
            :piececount p[h2-7] 1 
      )
     )
  )
)

Lame, but at least it works :)

26902: <p>I'm looking for a CQL query that will return all positions with the below pawn structure for both White and Black</p>
<pre><code> [FEN &quot;8/pp3ppp/4p3/8/3P4/8/PP3PPP/8 w - - 0 1&quot;]
</code></pre>
 26902: <p>All right, so I found the following query for the pawn structure in the diagram above:</p>
<pre><code>(match  ;query for IQP white 
      (position 
         :and (
            (position Pa2 Pb2 Pd4 Pf2 Pg2 Ph2 pa7 pb7 pe6 pf7 pg7 ph7)
            (position
            :piececount P[c2-7,e2-7] 0
            :piececount p[c2-7,d2-7] 0 )
         )
      )
)
</code></pre>
<p>For black though, I wanted to search for any IQP position, so I used this query:</p>
<pre><code>    (match ;query for IQP black
      (position
        :and (
          (position pd5)
          (position
            :piececount P[a2-7] 1
            :piececount P[b2-7] 1
            :piececount P[c2-7] 0
            :piececount P[d2-7] 0
            :piececount P[e2-7] 1
            :piececount P[f2-7] 1
            :piececount P[g2-7] 1
            :piececount P[h2-7] 1

            :piececount p[a2-7] 1 
            :piececount p[b2-7] 1 
            :piececount p[c2-7] 0 
            :piececount p[d2-7] 1 
            :piececount p[e2-7] 0 
            :piececount p[f2-7] 1 
            :piececount p[g2-7] 1 
            :piececount p[h2-7] 1 
      )
     )
  )
)
</code></pre>
<p>Lame, but at least it works :)</p>
