<p>Prolog allows to represent knowledge by facts and rules. A
fact and a rule have the following format:</p>

<pre><code>  A :- A1, .., An
</code></pre>

<p>Where A, A1, .., An are so called literals. If n=0 then its
a fact, if n>0 then its a rule.</p>

<p>A literal has the folllowing syntax, name is the predicate name
and the terms are the arguments of the predicate:</p>

<pre><code>  literal = atom [ "(" term { "," term } ].
</code></pre>

<p>Knowledge respresentation is an art in itself. There can be
many requirements to the representation, which can force it
to have a certain form.</p>

<p>But you can think as a literal as an excel sheet that is used
to hold a table. The columns that describe the column names are
not entered into Prolog as facts and rules, but you can use
Prolog <a href="http://arxiv.org/abs/0911.2899" rel="nofollow">comments</a> to enter the column names, such as:</p>

<pre><code>  % distance_between_cities(Atom, Atom, Float)
</code></pre>

<p>Or more specific:</p>

<pre><code>  % distance_between_cities(CityId, CityId, DistanceMiles)
</code></pre>

<p>After the first comment, you just enter the facts:</p>

<pre><code>  distance_between_cities('New York, US','Los Angeles, US',2443.85).
  distance_between_cities('New York, US','San Francisco, US',2563.89).
  distance_between_cities('Los Angeles, US','San Francisco, US',347.18).
</code></pre>

<p>Different predicate names can name different excel sheets 
so to speak. Some prolog systems even have <a href="http://www.swi-prolog.org/pldoc/man?section=csv" rel="nofollow">CSV</a> interfaces.</p>

<p>Bye</p>
Represent following fact in prolog
<p>I am learning prolog. I am wondering about how can i represent following fact in prolog?
<br>"There are 300 miles between someCityA and someCityB".
Anyone help please.I have searched for it enough but cant find solution to my specific problem.</p>