diff --git a/docs/codox/wildwood.caesar.html b/docs/codox/wildwood.caesar.html index 56d192a..be86216 100644 --- a/docs/codox/wildwood.caesar.html +++ b/docs/codox/wildwood.caesar.html @@ -23,7 +23,17 @@

Drusilla’s can be doubted because 1. She wasn’t a witness and 2. Is a woman.

Gaius’s can be doubted because 1. he wasn’t a witness, and because 2. it’s inconsistent with the evidence that Caesar was buried on the 18th.

The conclusion

-

Thus, I think, Falco must conclude that Brutus didn’t kill Caesar, because if he had he must have had accomplices (Cassius and Longus, who clearly were accomplices and implicate one another), but honourable men don’t kill with accomplices and Brutus is an honourable man.

anthony-kb

Mark Antony knows that Brutus is honourable, and that Caesar is buried.

april

The month of April, 44BC, as a range.

brutus-kb

Brutus will admit that he and Cassius were in the forum in the Ides of March

cassius-kb

Cassius and Longus each bear witness that the other killed Caesar in the Forum on the Ides of March.

drusila-kb

Drusila has heard that Brutus killed Caesar in the forum. She keys it on all three, for efficiency of retrieval.

eighteenth-march

18th March, 44BC

faldo-db

Falco believes that Caesar has been killed, but doesn’t know by whom or when.

gaius-db

Gaius has heard that Brutus killed Caesar, but believes it happened in April.

ides-of-march

16th March, 44BC

longus-kb

Cassius and Longus each bear witness that the other killed Caesar in the Forum on the Ides of March.

march

The month of March, 44BC, as a range.

-======= -wildwood.caesar documentation

wildwood.caesar

A dummy set of advocates and knowledge accessors with knowledge about the death of Julius Caesar.

april

The month of April, 44BC, as a range.

drusila-kb

Drusila knows that Longus killed Caesar in the forum. She keys it on all three, for efficiency of retrieval.

faldo-db

Falco knows that Caesar has been killed, but doesn’t know by whom or when.

gaius-db

Gaius knows that Brutus killed Caesar, but believes it happened in April.

ides-of-march

16th March, 44BC

marc-anthony-kb

Mark Antony knows that Brutus is honourable.

march

The month of March, 44BC, as a range.

->>>>>>> Stashed changes +

Thus, I think, Falco must conclude that Brutus didn’t kill Caesar, because if he had he must have had accomplices (Cassius and Longus, who clearly were accomplices and implicate one another), but honourable men don’t kill with accomplices and Brutus is an honourable man.

+

Features

+

The features in DTree terms we’re interested in to make these inferences are

+ +

Note that ALL of this is too complex for the simple DTree logic of the Arboretum / KnacqTools generation. They could not unpack propositions as I’m proposing here.

anthony-kb

Mark Antony knows that Brutus is honourable, and that Caesar is buried.

april

The month of April, 44BC, as a range.

brutus-kb

Brutus will admit that he and Cassius were in the forum in the Ides of March

cassius-kb

Cassius and Longus each bear witness that the other killed Caesar in the Forum on the Ides of March.

drusila-kb

Drusila has heard that Brutus killed Caesar in the forum. She keys it on all three, for efficiency of retrieval.

eighteenth-march

18th March, 44BC

faldo-db

Falco believes that Caesar has been killed, but doesn’t know by whom or when.

gaius-db

Gaius has heard that Brutus killed Caesar, but believes it happened in April.

ides-of-march

16th March, 44BC

longus-kb

Cassius and Longus each bear witness that the other killed Caesar in the Forum on the Ides of March.

march

The month of March, 44BC, as a range.

\ No newline at end of file diff --git a/docs/codox/wildwood.knowledge-accessor.html b/docs/codox/wildwood.knowledge-accessor.html index 2f749b5..108988c 100644 --- a/docs/codox/wildwood.knowledge-accessor.html +++ b/docs/codox/wildwood.knowledge-accessor.html @@ -1,3 +1,12 @@ -wildwood.knowledge-accessor documentation

wildwood.knowledge-accessor

The key point of building Bialowieza as a library rather than a complete application is that it should be possible to hook it up to multiple sources of knowledge. Thus we must design a protocol through which knowledge can be accessed, and a schema in which it will be returned. Note that the accessor must be able to add knowledge to the knowledge base, as well as retrieve it.

Accessor

protocol

members

fetch

(fetch self id)

Fetch all the knowledge I have about the object identified by this id value, as a map whose :id key has this id value.

store

(store self id proposition)

Add this proposition to the knowledge I hold about the object identified by this id value.

\ No newline at end of file +wildwood.knowledge-accessor documentation

wildwood.knowledge-accessor

The key point of building Bialowieza as a library rather than a complete application is that it should be possible to hook it up to multiple sources of knowledge. Thus we must design a protocol through which knowledge can be accessed, and a schema in which it will be returned. Note that the accessor must be able to add knowledge to the knowledge base, as well as retrieve it.

Accessor

protocol

members

fetch

(fetch self id)

Fetch all the knowledge I have about the object identified by this id value, as a map whose :id key has this id value.

+

NOTE THAT: I now think knowledge should only be managed at the Wildwood level as sets of propositions, so the idea of bringing back some sort of object representation here is probably wrong.

match

(match self proposition)

Return all the propositions I know which match this proposition. The intended use case here is that you will either supply a fully specified proposition to verify that that proposition is true, or else supply a partially specified proposition to query.

+

e.g. passing the proposition

+
{:verb :kill :object :caesar}
+
+

would be a way of asking ‘who killed caesar’, and might return

+
[{:verb :kill :subject :brutus :object :caesar}
+ {:verb :kill :subject :cassius :object :caesar}
+ {:verb :kill :subject :longus :object :caesar}]
+

store

(store self proposition)

Add this proposition to the knowledge I hold.

\ No newline at end of file diff --git a/src/wildwood/caesar.clj b/src/wildwood/caesar.clj index a1bd41d..35ee73e 100644 --- a/src/wildwood/caesar.clj +++ b/src/wildwood/caesar.clj @@ -57,6 +57,24 @@ he had he must have had accomplices (Cassius and Longus, who clearly were accomplices and implicate one another), but honourable men don't kill with accomplices and Brutus is an honourable man. + + ## Features + + The `features` in DTree terms we're interested in to make these inferences are + + * `did-kill` - true of an entity which is in the subject position of a `kill` proposition; + * `was-killed` - true of an entity which is in the object position of a `kill` proposition; + * `buried` - true of an entity which is in the object position of a `bury` proposition; + * `dead` - true of an entity of which either `was-killed` or `buried` is true; + * `honourable` - true of an entity, provided that `did-lie` and `did-murder` are false; + * `did-murder` - true of an entity x that `did-kill[x,y]` for some object y is true of, + provided that there exists some other entity p of whom `did-kill[p,x]` is also true, + or that `was-unarmed[y]` is true; + * `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. + * `was-unarmed` - true of an entity at a time `t` if they were unarmed at the time. + + Note that ALL of this is too complex for the simple DTree logic of the Arboretum / + KnacqTools generation. They could not unpack propositions as I'm proposing here. " (:require [wildwood.knowledge-accessor :refer [Accessor]] [wildwood.advocate :refer [Advocate]])) diff --git a/src/wildwood/knowledge_accessor.clj b/src/wildwood/knowledge_accessor.clj index e8c822b..277301c 100644 --- a/src/wildwood/knowledge_accessor.clj +++ b/src/wildwood/knowledge_accessor.clj @@ -10,7 +10,25 @@ (defprotocol Accessor (fetch [self id] "Fetch all the knowledge I have about the object identified by - this `id` value, as a map whose `:id` key has this `id` value.") - (store [self id proposition] - "Add this `proposition` to the knowledge I hold about the object - identified by this `id` value.")) + this `id` value, as a map whose `:id` key has this `id` value. + + *NOTE THAT:* I now think knowledge should only be managed at the + Wildwood level as sets of propositions, so the idea of bringing + back some sort of object representation here is probably wrong.") + (match [self proposition] + "Return all the propositions I know which match this proposition. The + intended use case here is that you will either supply a fully + specified proposition to verify that that proposition is true, or else + supply a partially specified proposition to query. + + e.g. passing the proposition + + {:verb :kill :object :caesar} + + would be a way of asking 'who killed caesar', and might return + + [{:verb :kill :subject :brutus :object :caesar} + {:verb :kill :subject :cassius :object :caesar} + {:verb :kill :subject :longus :object :caesar}]") + (store [self proposition] + "Add this `proposition` to the knowledge I hold.")) diff --git a/src/wildwood/mongo_ka.clj b/src/wildwood/mongo_ka.clj index 1817e7f..60d4a11 100644 --- a/src/wildwood/mongo_ka.clj +++ b/src/wildwood/mongo_ka.clj @@ -38,7 +38,10 @@ (assoc (dissoc record :_id) :id id)))) - (store [_ id proposition] + (match [_ proposition] + ;; I know I've seen how to do this in the Mongo documentation... + ) + (store [_ proposition] ;; don't really know how to do this and am too tired just now. ))