Added cloverage output to archive
This commit is contained in:
parent
81a4426235
commit
d539caf25a
40
docs/cloverage/coverage.css
Normal file
40
docs/cloverage/coverage.css
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
.covered {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
background-color: #558B55;
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-covered {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.partial {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
background-color: orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-tracked {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blank {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.with-bar {
|
||||||
|
width: 250px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.with-number {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.ns-name {
|
||||||
|
min-width: 150px;
|
||||||
|
padding-right: 25px;
|
||||||
|
}
|
135
docs/cloverage/index.html
Normal file
135
docs/cloverage/index.html
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="./coverage.css"/>
|
||||||
|
<title>Coverage Summary</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<thead><tr>
|
||||||
|
<td class="ns-name"> Namespace </td>
|
||||||
|
<td class="with-bar"> Forms </td>
|
||||||
|
<td class="with-number">Forms %</td>
|
||||||
|
<td class="with-bar"> Lines </td>
|
||||||
|
<td class="with-number">Lines %</td>
|
||||||
|
<td class="with-number">Total</td><td class="with-number">Blank</td><td class="with-number">Instrumented</td>
|
||||||
|
</tr></thead>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/advocate.clj.html">wildwood.advocate</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:100.0%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:100.0%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">47</td><td class="with-number">5</td><td class="with-number">2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/bialowieza.clj.html">wildwood.bialowieza</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:66.66666666666667%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:33.333333333333336%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">66.67 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:50.0%;
|
||||||
|
float:left;"> 1 </div><div class="partial"
|
||||||
|
style="width:50.0%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">30</td><td class="with-number">7</td><td class="with-number">2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/caesar.clj.html">wildwood.caesar</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:100.0%;
|
||||||
|
float:left;"> 353 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:100.0%;
|
||||||
|
float:left;"> 38 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">144</td><td class="with-number">37</td><td class="with-number">38</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/dengine/engine.clj.html">wildwood.dengine.engine</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:66.66666666666667%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:33.333333333333336%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">66.67 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:50.0%;
|
||||||
|
float:left;"> 1 </div><div class="partial"
|
||||||
|
style="width:50.0%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">13</td><td class="with-number">1</td><td class="with-number">2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/dengine/node.clj.html">wildwood.dengine.node</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:60.0%;
|
||||||
|
float:left;"> 3 </div><div class="not-covered"
|
||||||
|
style="width:40.0%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">60.00 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:33.333333333333336%;
|
||||||
|
float:left;"> 1 </div><div class="partial"
|
||||||
|
style="width:66.66666666666667%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">15</td><td class="with-number">3</td><td class="with-number">3</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/knowledge_accessor.clj.html">wildwood.knowledge-accessor</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:100.0%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:100.0%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">34</td><td class="with-number">6</td><td class="with-number">2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/mongo_ka.clj.html">wildwood.mongo-ka</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:5.0%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:95.0%;
|
||||||
|
float:left;"> 38 </div></td>
|
||||||
|
<td class="with-number">5.00 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:18.181818181818183%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:81.81818181818181%;
|
||||||
|
float:left;"> 9 </div></td>
|
||||||
|
<td class="with-number">18.18 %</td>
|
||||||
|
<td class="with-number">47</td><td class="with-number">4</td><td class="with-number">11</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="wildwood/schema.clj.html">wildwood.schema</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:97.6608187134503%;
|
||||||
|
float:left;"> 167 </div><div class="not-covered"
|
||||||
|
style="width:2.3391812865497075%;
|
||||||
|
float:left;"> 4 </div></td>
|
||||||
|
<td class="with-number">97.66 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:92.3076923076923%;
|
||||||
|
float:left;"> 48 </div><div class="partial"
|
||||||
|
style="width:5.769230769230769%;
|
||||||
|
float:left;"> 3 </div><div class="not-covered"
|
||||||
|
style="width:1.9230769230769231%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">98.08 %</td>
|
||||||
|
<td class="with-number">129</td><td class="with-number">15</td><td class="with-number">52</td>
|
||||||
|
</tr>
|
||||||
|
<tr><td>Totals:</td>
|
||||||
|
<td class="with-bar"></td>
|
||||||
|
<td class="with-number">92.06 %</td>
|
||||||
|
<td class="with-bar"></td>
|
||||||
|
<td class="with-number">91.07 %</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
149
docs/cloverage/wildwood/advocate.clj.html
Normal file
149
docs/cloverage/wildwood/advocate.clj.html
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> wildwood/advocate.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.advocate
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "An agent capable of playing the explanation game.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
003
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 An advocate must have its own knowledge accessor. Different advocates
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 within a game may be accessing different knowledge bases, or different
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 subsets of the same knowledge base with different - potentially competing
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 - knowledge. It also needs to know the schema in which knowledge will be
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 presented.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 Since the mechanism by which the application will communicate with the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 library must include a way for users to interact with the game, and
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 since the role of the user in the came is just as a participant,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 advocate must be defined as a protocol, in order that it may be extended
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 by code within the application which is passed in to the game when the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 game is started. Indeed, multiple agents - the user(s) and potentially
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 non-player characters - may be passed in.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
017
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 In this conception, nothing within a default advocate has to be able to
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 produce or consume natural language. It is sufficient for the API exposed
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 by wildwood.advocate to receive and return wildwood.schema objects.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
021
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 Obviously to show a user interface anything similar to Arden's, or for
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 what I intend for The Great Game, the advocates passed must 'at their
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 other end' - that is, on the application side rather than the library
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 side - be able to consume and emit natural language, but that functionality
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 does not need to be part of the wildwood library, and certainly does
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 not need to be part of the default advocate as specified here."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 (:require [wildwood.knowledge-accessor :refer [Accessor]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 [wildwood.schema :refer [proposition? argument?]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
030
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
031 (defprotocol Advocate
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
032 (record [self proposition value]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 "Pass a `proposition` with a determined `value` to me, in order that
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 advocates can, if desired, record the determined value in their
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 knowledge base. The API does not require that the advocate records
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 the decision, only that it has the opportunity to do so. Return the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
037 value.")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
038 (id [self] "Return a value which uniquely identifies this agent.")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
039 (decide [self proposition argument]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
040 "Return `true`, `false` or `nil` as the value of this `proposition`,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
041 given this `argument`. The value of `proposition` should be a
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 proposition as defined by `wildwood.schema/proposition?`;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
043 the value of `argument` should satisfy `wildwood.schema/argument?`.")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 (move [self proposition argument]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
045 "Return a new argument structure representing the result of applying my
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 `decide` method to this `proposition` and `argument`, specifying in
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 some way not yet determined what sort of move I have made."))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
98
docs/cloverage/wildwood/bialowieza.clj.html
Normal file
98
docs/cloverage/wildwood/bialowieza.clj.html
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> wildwood/bialowieza.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.bialowieza
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "The second iteration of the core inference engine for Wildwood"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 (:require [wildwood.advocate :refer [Advocate]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 [wildwood.schema :refer [proposition?]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
005
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 ;; to start a game we must have n advocates, where n > 1. Each must have
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 ;; its own knowledge accessor, so at the level of the game engine we don't
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 ;; need to know how to access knowledge.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
010 (defn decide
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 "Decide the truth value of this `proposition` by convening a game between
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 these advocate `agents`. Iterate the game until all agents PASS; then finally
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 offer each agent's `record` method the `proposition` together with the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 decided truth value (`true` or `false`), before returning that value.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
015
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 The `proposition` is a proposition as defined in the `wildwood.schema`;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 that is to say, the predicate `wildwood.schema/predicate?` returns true
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 of it. If the proposition isn't a predicate, throw an exception.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
019
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 Each of `agents` should be an object implementing the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 `wildwood.advocate/Advocate` protocol. If an agent isn't an Advocate,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 throw an exception.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
023
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 Do not throw an exception under any other circumstances.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
025
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 If an agent throws an exception, catch it and treat it as a PASS."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 [proposition & agents]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;; TODO: actually write it.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
029
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 false)
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
440
docs/cloverage/wildwood/caesar.clj.html
Normal file
440
docs/cloverage/wildwood/caesar.clj.html
Normal file
|
@ -0,0 +1,440 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> wildwood/caesar.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.caesar
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "A dummy set of advocates and knowledge accessors with knowledge about the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 death of Julius Caesar.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
004
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 # The Case Against Marcus Brutus
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
006
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 Did Brutus conspire to kill Caesar in the forum in the Ides of March?
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
008
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 Falco, the detective, must find out.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
010
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ## The witnesses
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
012
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 Anthony knows that Brutus is honourable, and that Caesar is buried.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
014
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 Brutus will admit he was in the forum on the ides of March and is a witness
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 that Cassius was also present.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
017
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 Cassius and Longus each bear witness that the other killed Caesar in the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 Forum on the Ides of March.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
020
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 Drusilla believes that Brutus killed Caesar in the Forum on the Ides of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 March, but was not a witness. She also bears witness that Caesar was buried
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 on the 18th March.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
024
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 Gaius believes that Brutus killed Caesar in the Forum in April, but was not
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 a witness.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
027
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ## The rules
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
029
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 There is a rule which says that if you kill someone and you have accomplices
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 then you're not honourable, and a default that has-accomplices is false.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 Note that has-accomplices boils down to
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 > For a given verb, object, location and time, there is more than one subject.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
035
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 That's quite sophisticated to represent.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
037
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
038 There is a rule which says you can't be killed after you're dead (temporal
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
039 reasoning).
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
040
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
041 There is a rule which says if you've been killed or been buried then you're
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 dead.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
043
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 The case against Brutus is based on Drusilla's claim and on Gaius's.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
045
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 Drusilla's can be doubted because
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 1. She wasn't a witness and
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
048 2. Is a woman.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
049
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
050 Gaius's can be doubted because
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
051 1. he wasn't a witness, and because
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
052 2. it's inconsistent with the evidence that Caesar was buried on the 18th.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
053
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
054 ## The conclusion
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
055
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
056 Thus, I think, Falco must conclude that Brutus didn't kill Caesar, because if
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
057 he had he must have had accomplices (Cassius and Longus, who clearly were
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
058 accomplices and implicate one another), but honourable men don't kill with
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
059 accomplices and Brutus is an honourable man.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
060
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
061 ## Features
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
062
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
063 The `features` in DTree terms we're interested in to make these inferences are
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
064
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
065 * `did-kill` - true of an entity which is in the subject position of a `kill` proposition;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
066 * `was-killed` - true of an entity which is in the object position of a `kill` proposition;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
067 * `buried` - true of an entity which is in the object position of a `bury` proposition;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
068 * `dead` - true of an entity of which either `was-killed` or `buried` is true;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
069 * `honourable` - true of an entity, provided that `did-lie` and `did-murder` are false;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
070 * `did-murder` - true of an entity x that `did-kill[x,y]` for some object y is true of,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
071 provided that there exists some other entity p of whom `did-kill[p,x]` is also true,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
072 or that `was-unarmed[y]` is true;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
073 * `did-lie` - true of an entity which has offered a proposition which for other reasons we do not believe. Tricky. False by default and I think we probably leave it at that for now.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
074 * `was-unarmed` - true of an entity at a time `t` if they were unarmed at the time.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
075
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
076 Note that ALL of this is too complex for the simple DTree logic of the Arboretum /
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
077 KnacqTools generation. They could not unpack propositions as I'm proposing here.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
078 "
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
079 (:require [wildwood.knowledge-accessor :refer [Accessor]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
080 [wildwood.advocate :refer [Advocate]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
081
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
082
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
083 (def ides-of-march
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
084 "16th March, 44BC"
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
085 (+ -440000 300 16))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
086
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
087 (def eighteenth-march
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
088 "18th March, 44BC"
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
089 (+ -440000 300 18))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
090
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
091 (def march
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
092 "The month of March, 44BC, as a range."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="13 out of 13 forms covered">
|
||||||
|
093 (sort [(+ -440000 300 1) (+ -440000 300 30)]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
094
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
095 (def april
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
096 "The month of April, 44BC, as a range."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="13 out of 13 forms covered">
|
||||||
|
097 (sort [(+ -440000 400 1) (+ -440000 400 30)]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
098
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
099 (def anthony-kb
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
100 "Mark Antony knows that Brutus is honourable, and that Caesar is buried."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="11 out of 11 forms covered">
|
||||||
|
101 {:brutus [{:verb :is :subject :brutus :object :honourable}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="12 out of 12 forms covered">
|
||||||
|
102 :caesar [{:verb :bury :subject :calpurnia :object :caesar :date eighteenth-march :nth-hand 1}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
103
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
104 (def brutus-kb
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
105 "Brutus will admit that he and Cassius were in the forum in the Ides of March"
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="18 out of 18 forms covered">
|
||||||
|
106 {:brutus [{:verb :present :subject :brutus :object :forum :location :forum :date ides-of-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
107 :cassius [{:verb :present :subject :cassius :object :forum :location :forum :date ides-of-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
108 :forum [{:verb :present :subject :brutus :object :forum :location :forum :date ides-of-march :nth-hand 1}
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="13 out of 13 forms covered">
|
||||||
|
109 {:verb :present :subject :cassius :object :forum :location :forum :date ides-of-march :nth-hand 1}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
110
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
111 (def cassius-kb
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
112 "Cassius and Longus each bear witness that the other killed Caesar in the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
113 Forum on the Ides of March."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="18 out of 18 forms covered">
|
||||||
|
114 {:caesar [{:verb :kill :subject :longus :object :caesar :location :forum :date ides-of-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
115 :longus [{:verb :kill :subject :longus :object :caesar :location :forum :date ides-of-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
116 :forum [{:verb :kill :subject :longus :object :caesar :location :forum :date ides-of-march :nth-hand 1}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
117
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
118 (def drusila-kb
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
119 "Drusila has heard that Brutus killed Caesar in the forum. She keys it on all three, for efficiency
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
120 of retrieval."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="18 out of 18 forms covered">
|
||||||
|
121 {:caesar [{:verb :kill :subject :brutus :object :caesar :location :forum :date ides-of-march :nth-hand 2}
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="11 out of 11 forms covered">
|
||||||
|
122 {:verb :bury :subject :calpurnia :object :caesar :date eighteenth-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
123 :brutus [{:verb :kill :subject :brutus :object :caesar :location :forum :date ides-of-march :nth-hand 2}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
124 :forum [{:verb :kill :subject :brutus :object :caesar :location :forum :date ides-of-march :nth-hand 2}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
125
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
126 (def faldo-db
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
127 "Falco believes that Caesar has been killed, but doesn't know by whom or when."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="12 out of 12 forms covered">
|
||||||
|
128 {:caesar [{:verb :kill :object :caesar :location :forum}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="8 out of 8 forms covered">
|
||||||
|
129 :brutus [{:verb :kill :object :caesar :location :forum}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="8 out of 8 forms covered">
|
||||||
|
130 :forum [{:verb :kill :object :caesar :location :forum}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
131
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
132 (def gaius-db
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
133 "Gaius has heard that Brutus killed Caesar, but believes it happened in April."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="18 out of 18 forms covered">
|
||||||
|
134 {:caesar [{:verb :kill :subject :brutus :object :caesar :location :forum :date april :nth-hand 2}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
135 :brutus [{:verb :kill :subject :brutus :object :caesar :location :forum :date april :nth-hand 2}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
136 :forum [{:verb :kill :subject :brutus :object :caesar :location :forum :date april :nth-hand 2}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
137
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
138 (def longus-kb
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
139 "Cassius and Longus each bear witness that the other killed Caesar in the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
140 Forum on the Ides of March."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="18 out of 18 forms covered">
|
||||||
|
141 {:caesar [{:verb :kill :subject :cassius :object :caesar :location :forum :date ides-of-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
142 :cassius [{:verb :kill :subject :cassius :object :caesar :location :forum :date ides-of-march :nth-hand 1}]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="14 out of 14 forms covered">
|
||||||
|
143 :forum [{:verb :kill :subject :cassius :object :caesar :location :forum :date ides-of-march :nth-hand 1}]})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
144
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
47
docs/cloverage/wildwood/dengine/engine.clj.html
Normal file
47
docs/cloverage/wildwood/dengine/engine.clj.html
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> wildwood/dengine/engine.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.dengine.engine
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "An implementation of the DTree engine adapted to `wildwood.schema` propositions."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 (:require [wildwood.knowledge-accessor :refer [Accessor]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 [wildwood.schema :refer [proposition?]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
005
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
006 (defn decide
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 "Decide the truth value of this `proposition`, using the dtree rooted at
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 this `node` and knowledge provided by this `accessor`."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 ;; how is explanation returned in this schema? We need a richer return value
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;; than just a truth value.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 [proposition node accessor]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;; TODO: implement
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 false)
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
53
docs/cloverage/wildwood/dengine/node.clj.html
Normal file
53
docs/cloverage/wildwood/dengine/node.clj.html
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> wildwood/dengine/node.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.dengine.node
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "A dtree node.")
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
003
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
004 (defn node?
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 "Return `true` if this `o` is recognisable as a dtree node, else `false`."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 ;; TODO: implement
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [o]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 false)
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
010 (defn colour
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 "If this `node` is a valid dtree node, return its colour."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 [node]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;; TODO: implement
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 false)
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
015
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
110
docs/cloverage/wildwood/knowledge_accessor.clj.html
Normal file
110
docs/cloverage/wildwood/knowledge_accessor.clj.html
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> wildwood/knowledge_accessor.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.knowledge-accessor
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "The key point of building Bialowieza as a library rather than a complete
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 application is that it should be possible to hook it up to multiple sources
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 of knowledge. Thus we must design a protocol through which knowledge can be
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 accessed, and a schema in which it will be returned. Note that the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 accessor must be able to add knowledge to the knowledge base, as well as
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 retrieve it."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 (:require [wildwood.schema :refer [proposition?]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
010 (defprotocol Accessor
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 (fetch [self id]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 "Fetch all the knowledge I have about the object identified by
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 this `id` value, as a map whose `:id` key has this `id` value.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
014
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 *NOTE THAT:* I now think knowledge should only be managed at the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 Wildwood level as sets of propositions, so the idea of bringing
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 back some sort of object representation here is probably wrong.")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 (match [self proposition]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 "Return all the propositions I know which match this proposition. The
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 intended use case here is that you will either supply a fully
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 specified proposition to verify that that proposition is true, or else
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 supply a partially specified proposition to query.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
023
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 e.g. passing the proposition
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
025
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 {:verb :kill :object :caesar}
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
027
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 would be a way of asking 'who killed caesar', and might return
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
029
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 [{:verb :kill :subject :brutus :object :caesar}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 {:verb :kill :subject :cassius :object :caesar}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
032 {:verb :kill :subject :longus :object :caesar}]")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 (store [self proposition]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 "Add this `proposition` to the knowledge I hold."))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
149
docs/cloverage/wildwood/mongo_ka.clj.html
Normal file
149
docs/cloverage/wildwood/mongo_ka.clj.html
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> wildwood/mongo_ka.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.mongo-ka
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "A knowledge accessor fetching from and storing to Mongo DB.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
003
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 Hierarchical databases seem a very natural fit for how we're storing
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 knowledge. Mongo DB seems a particularly natural fit since its
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 internal representation is JSON, which can be transformed to EDN
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 extremely naturally."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 (:require [monger.core :as mg]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 [monger.collection :as mc]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 [wildwood.knowledge-accessor :refer [Accessor]])
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 (:import [com.mongodb MongoOptions ServerAddress]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 [com.mongodb DB WriteConcern]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 [org.bson.types ObjectId]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
014
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;; MongoDB data items are identified by ObjectId objects. In the retrieved
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;; record from MongoDB, key value is the value of a keyword `:_id` I don't
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;; think there's any *in principle* reason why we should not use these objects
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;; as key values - they're presumably designed to be globally unique.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;; In which case, on the way down we have to set `:_id` to the value of `:id`
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;; and vice versa on the way back up.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
022
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
023 (defrecord MongoKA
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;; It's not clear to me whether we need to pass both the connection and the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;; database in - it's possible that the connected database handle is
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;; sufficient. The value of `:collection` is the name of the collection
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;; within the database to which this accessor writes.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 [connection db ^String collection]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 Accessor
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 (fetch
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 [_ id]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
032 (let [oid (cond
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
033 (instance? ObjectId id) id
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
034 (string? id) (ObjectId. id)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
035 (keyword? id) (ObjectId. (name id)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
036 record (mc/find-by-id db collection oid)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
037 (when record
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
038 (assoc
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
039 (dissoc record :_id)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
040 :id id))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
041 (match [_ proposition]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 ;; I know I've seen how to do this in the Mongo documentation...
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
043 )
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 (store [_ proposition]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
045 ;; don't really know how to do this and am too tired just now.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 ))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
047
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
395
docs/cloverage/wildwood/schema.clj.html
Normal file
395
docs/cloverage/wildwood/schema.clj.html
Normal file
|
@ -0,0 +1,395 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> wildwood/schema.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns wildwood.schema
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 "The knowledge representation. This probably ends up looking a bit like a
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 Toulmin schema, where claims are represented as propositions. There also
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 need to be rules or predicates, things which can test whether a given
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 proposition has a given value. There may be other stuff in here.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
006
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 Internal representation of most of this will be as Clojure maps."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 )
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
010 (def required-keys
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 "Every proposition is expected to have values for these keys."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="4 out of 4 forms covered">
|
||||||
|
012 #{:verb :subject :object})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
013
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
014 (def consensual-keys
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 "Every proposition which has these keys, in a given decision process,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 must have the same semantics and types for their values. The exact
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 representations used for the values of these keys does not
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 matter, it is consensual between all participating advocates in a
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 decision process."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
020 #{:time ;; a representation of time - which should have a canonical ordering;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 :location ;; a representation of place - which may have concepts of proximity;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 :truth ;; if present and value `false`, negates the proposition;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 :data ;; an argument structure...!
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 })
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
025
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
026 (def argument-keys
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 "Every argument is a proposition, which additionally has these keys."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
028 #{:confidence ;; how sure am I? A value, perhaps, in the range -1 to 1, although conventionally if less than 1 we probably set the `:truth` value to false;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 :authority ;; id of agent from whom, or rule from which, I know this.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 })
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
031
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
032 (def preserved-keys
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 "Keys whose values should not be minimised during proposition minimisation"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 ;; TODO: actually, this may end up being just :data
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="6 out of 6 forms covered">
|
||||||
|
035 (set (cons :data argument-keys)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
036
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
037 (defn proposition?
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
038 "True if `o` qualifies as a proposition. A proposition is probably a map
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
039 with some privileged keys, and may look something like a minimised
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
040 `the-great-game.gossip.news-items` item.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
041
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 If `minimised` is passed and is `true`, then the proposition must
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
043 be minimised - that is to say, the values of keys in a proposition map may
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 not themselves be keys. Where the value of a key represents an object in the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
045 world, that value must be simply the `id` of the object, not a richer
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 representation."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 ([o]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
048 (and
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
049 (map? o)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="6 out of 6 forms covered">
|
||||||
|
050 (every? #(o %) required-keys)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
051 ([o minimised]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
052 (and
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
053 (proposition? o))
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
054 (not
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
055 (when
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
056 (true? minimised)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
057 ;; not good enough. An argument is a proposition even if its argument-keys
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
058 ;; are not minimised (indeed, they should not be). TODO: fix.
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="6 out of 6 forms covered">
|
||||||
|
059 (some map? (vals o))))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
060
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
061 (defn truth
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
062 "If `p` is a proposition, return whether the value asserted by that
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
063 proposition is `true`. If the `:truth` key is missing, `true` is
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
064 assumed."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
065 ;; TODO: for orthogonality, this might be renamed `decide`.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
066 [p]
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
067 (if
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
068 (proposition? p)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
069 (if
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
070 (false? (:truth p))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
071 false
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
072 true)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
073 nil))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
074
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
075 (defn rule?
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
076 "True if `o` qualifies as a rule. A rule is a structure which comprises
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
077 * an id and
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
078 * a function of two arguments, a proposition and a knowledge accessor,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
079 and which should (if this can simply be checked) return an argument
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
080 structure."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
081 [o]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
082 ;; TODO: write this. In practice it may be simpler if we defprotocol or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
083 ;; defrecord a rule structure.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
084 false)
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
085
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
086 (defn argument?
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
087 "True if `o` qualifies as an argument structure.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
088
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
089 An argument structure is a (potentially rich) proposition which, in addition, should have values
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
090 for `:confidence` and `:authority`. A value for `:data` may, and probably will,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
091 also be present but is not required. The value of `:confidence` must be a number
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
092 in the range -1 to 1."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
093 [o]
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="14 out of 15 forms covered">
|
||||||
|
094 (and
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
095 (proposition? o)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="7 out of 7 forms covered">
|
||||||
|
096 (every? #(o %) argument-keys)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
097 (number? (:confidence o))
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="4 out of 4 forms covered">
|
||||||
|
098 (<= -1 (:confidence o) 1)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
099
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="6 out of 6 forms covered">
|
||||||
|
100 (set (cons :data argument-keys))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
101
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
102 (defn minimise
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
103 "Expecting that `o` is a (potentially rich) proposition, return a map identical
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
104 to `o` save that for each value `v` of key `k` in `o`, if `v` is a map and `k`
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
105 is not a member of `argument-keys`, then the returned map shall substitute the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
106 value of `(:id v)`.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
107
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
108 see also `wildwood.knowledge-access/maximise`."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
109 [o]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
110 (if
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
111 (map? o)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
112 (reduce
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
113 merge
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
114 {}
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
115 (map
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
116 (fn [k]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
117 {k
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="4 out of 4 forms covered">
|
||||||
|
118 (let [v (k o)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
119 (if
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="12 out of 12 forms covered">
|
||||||
|
120 (and (not (preserved-keys k)) (map? v))
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
121 (:id v)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
122 v))})
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
123 (keys o)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
124 o))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
125
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
126 (proposition?
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="7 out of 7 forms covered">
|
||||||
|
127 (minimise {:verb :kill
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
128 :subject {:id :brutus :name "Marcus Brutus"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="7 out of 7 forms covered">
|
||||||
|
129 :object {:id :caesar :name "Gaius Julius Caesar" :wife :drusila}}))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
22
project.clj
22
project.clj
|
@ -1,19 +1,21 @@
|
||||||
(defproject wildwood "0.1.0-SNAPSHOT"
|
(defproject wildwood "0.1.0-SNAPSHOT"
|
||||||
:description "A general inference library using a game theoretic inference mechanism."
|
:cloverage {:output "docs/cloverage"}
|
||||||
:url "http://example.com/FIXME"
|
|
||||||
:license {:name "GNU General Public License,version 2.0 or (at your option) any later version"
|
|
||||||
:url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"}
|
|
||||||
:dependencies [[org.clojure/clojure "1.8.0"]
|
|
||||||
[org.clojure/math.numeric-tower "0.0.4"]
|
|
||||||
[com.taoensso/timbre "4.10.0"]
|
|
||||||
[com.novemberain/monger "3.1.0"]
|
|
||||||
[prismatic/schema "1.1.12"]]
|
|
||||||
:codox {:metadata {:doc "**TODO**: write docs"
|
:codox {:metadata {:doc "**TODO**: write docs"
|
||||||
:doc/format :markdown}
|
:doc/format :markdown}
|
||||||
:output-path "docs/codox"
|
:output-path "docs/codox"
|
||||||
:source-uri "https://github.com/simon-brooke/the-great-game/blob/master/{filepath}#L{line}"}
|
:source-uri "https://github.com/simon-brooke/the-great-game/blob/master/{filepath}#L{line}"}
|
||||||
|
:dependencies [[org.clojure/clojure "1.8.0"]
|
||||||
|
[org.clojure/math.numeric-tower "0.0.4"]
|
||||||
|
[com.taoensso/timbre "4.10.0"]
|
||||||
|
[com.novemberain/monger "3.1.0"] ;; not yet used
|
||||||
|
[prismatic/schema "1.1.12"]] ;; not yet used
|
||||||
|
:description "A general inference library using a game theoretic inference mechanism."
|
||||||
|
:license {:name "GNU General Public License,version 2.0 or (at your option) any later version"
|
||||||
|
:url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"}
|
||||||
:plugins [[lein-cloverage "1.1.1"]
|
:plugins [[lein-cloverage "1.1.1"]
|
||||||
[lein-codox "0.10.7"]
|
[lein-codox "0.10.7"]
|
||||||
[lein-cucumber "1.0.2"]
|
[lein-cucumber "1.0.2"]
|
||||||
[lein-gorilla "0.4.0"]]
|
[lein-gorilla "0.4.0"]]
|
||||||
:repl-options {:init-ns wildwood.core})
|
:repl-options {:init-ns wildwood.core}
|
||||||
|
:url "https://simon-brooke.github.io/wildwood/"
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue