<p>It sounds like <a href="https://en.wikipedia.org/wiki/Placement_(EDA)" rel="nofollow noreferrer">placement</a> problem to me, so you should try investigating approaches to solve it.</p>
<p>I'll use <a href="https://en.wikipedia.org/wiki/Satisfiability" rel="nofollow noreferrer">satisfiability</a> framework to discuss uncertainty and related stuff. You can define <strong>a 2D grid</strong>, each node can hold <em>features</em> - a hill, a river, a mountain. Features could be generic or special (Mt. Foobar). Some features could be predefined - you can place a mountain at specified node, but it's up to you. Cities are defined as features too.</p>
<p>Now, interesting part. You can define a set of constraints <strong>over</strong> such grid. So, for each node in a grid you can define something like this:</p>
<blockquote>
<p>IF city A takes place at node THEN a mountain must be at an adjacent node</p>
<p>IF given node contains a mountain THEN city A must be at any of adjacent nodes</p>
<p>IF city A is present at given node THEN city B can't be at any of adjacent nodes</p>
</blockquote>
<p>You can introduce a lot of various constraints in such way, even with counting objects:</p>
<blockquote>
<p>IF a node has a river THEN no more than 2 cities could be at adjacent nodes</p>
</blockquote>
<p>To do so, you can rely on <a href="http://minisat.se/downloads/MiniSat+.pdf" rel="nofollow noreferrer">pseudo-boolean constraints</a>. You can use it even for optimizing solutions by introducing counters for specific configurations and require that here must be <em>more than</em> or <em>less than</em> of them.</p>
<p>To solve resulting problem you can use any of SAT solvers (e.g. <a href="http://www.labri.fr/perso/lsimon/glucose/" rel="nofollow noreferrer">Glucose</a>)</p>
<p>You can generate several <em>different</em> solutions by using <a href="https://arxiv.org/abs/1510.00523" rel="nofollow noreferrer">AllSAT</a>, there are solvers for that too.</p>
<p>If purely Boolean formulation is too complex, you can try <a href="https://en.wikipedia.org/wiki/Satisfiability_modulo_theories" rel="nofollow noreferrer">SMT</a></p>
<p>Details how to implement such systems are out the question's scope, it's too broad and require plenty of preliminary studies.</p>
<p>Hope that my answer is helpful.</p>
<p>EDIT</p>
<p>SAT solver returns <em>first</em> correct solution and it'll be random in this sense.</p>
Uncertainty in a logic engine (Produce plausible relative positions based on local geography)
<p>I know there's a high chance of my hitting the XY problem here, so the first chunk of this is about the more general situation.</p>
<hr />
<h2>The Problem</h2>
<p>I have a set of data points containing abstract geographic-feature information, but no actual locations (absolute or relative). For the sake of example, let's call it the following list of cities that describes the local terrain, but with no coordinates or relative positioning:</p>
<ul>
<li>City A is on an island and on a hill.</li>
<li>City B is on the coast and near a river.</li>
<li>City C is on a mountain and near a river</li>
<li>City D is on an island and on a hill.</li>
<li>City E is on an island and on plains.</li>
</ul>
<p>From this, I want to write a program that can provide relative positions for these locations. For the above list, it might derive that A and D are near each other, E might be near them but is less likely, and B and C might be near each other. You can think of it as a graph with all the edges rubbed out, and the program tries to write them back in based on the properties of the nodes. Given that, it could then come up with some arbitrary coordinates for each city, from which a map might be drawn.</p>
<p>I don't need a unique solution – my end-goal here is plausible maps of unmapped-but-described fictional places.</p>
<p>This seems to me to be the sort of problem that's a good fit for e.g. Prolog or similar logic-engines, since it's basically just constraint resolution. However, I can't quite work it out myself. The issues I'm hitting at the moment relate to the way that, for example, two cities could have similar local features without being near the same instance of that larger feature. It's the difference between &quot;This city is near some unspecified mountain&quot; and &quot;This city is near Mt. Foobar.&quot; The latter provides a strong constraint (two cities both near Mt. Foobar are near each other), but the latter only provides a guideline (two cities both near mountains are more likely to be near each other than one city near a mountain and another city not near a mountain).</p>
<hr />
<h2>The Question</h2>
<p>How does one define (and provide solutions based on) probabilities, rather than absolutes, in Prolog or other logic/rules engines?</p>