title: Prolog: Parsing a term for semantic correctness (pattern matching)
body: <p>I am working on an assignment and I am woefully stuck. I have little experience with prolog and I am learning on the job based on online material and a textbook.</p>
  
  <p>The aim of the assignment is to produce a predicate, parse(), that is able to check that a given argument/term is of the following form, returning true or false as appropriate:</p>
  
  <ul>
  <li>((int,int),[(int,float),(int,float)...])</li>
  </ul>
  
  <p>So an int pair, followed by an n-sized list of (int,float) pairs, with both wrapped up in a tuple.</p>
  
  <p>For example:</p>
  
  <ul>
  <li>( (1, 7), [(1, 0.0), (2, 0.5), (3, 0.7), (4, 0.8), (5, 0.8), (6,
  0.25), (7, 0.3)] )</li>
  </ul>
  
  <p>Could anyone point me in the right direction for where to begin on this? I haven't ever done this sort of this in Prolog.</p>
  
  <p>I am not looking for a full coded answer, naturally this is an assignment, but just some direction for how to approach this problem. I have no declarative programming background, so this is an educational exercise.</p>
  
  <p>Thanks!</p>