title: How to call a predicate from another predicate in Prolog?
body: <p>So I just started Prolog and I was wondering two things: </p>
  
  <p>1) Is there built in functions (or are they all called predicates?) for simple things like max of 2 numbers, or sine of a number, etc... If so, how do I access them? </p>
  
  <p>2) How can I call a predicate from another one? I wrote two predicates called car and cdr. car returns the head of a list and cdr returns the list without the head. But now I want to call car on the cdr. Here are some examples for clarification:</p>
  
  <pre><code>car([3,4,5,5], H). would return H = 3
  
  cdr([3,4,5,5],L). would return L = [4,5,5]
  </code></pre>
  
  <p>and what I am asking is how can I do this:</p>
  
  <pre><code>car(cdr[3,4,5,5]))
  </code></pre>
  
  <p>??</p>