diff --git a/docs/codox/index.html b/docs/codox/index.html index 5b7c5d0..0736575 100644 --- a/docs/codox/index.html +++ b/docs/codox/index.html @@ -1,3 +1,3 @@ -Wildwood 0.1.0-SNAPSHOT

Wildwood 0.1.0-SNAPSHOT

Released under the EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0

A general inference library using a game theoretic inference mechanism.

Installation

To install, add the following dependency to your project or build file:

[wildwood "0.1.0-SNAPSHOT"]

Topics

Namespaces

wildwood.advocate

An agent capable of playing the explanation game.

Public variables and functions:

wildwood.bialowieza

The second iteration of the core inference engine for Wildwood

Public variables and functions:

wildwood.caesar

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

wildwood.dengine.engine

An implementation of the DTree engine adapted to wildwood.schema propositions.

Public variables and functions:

wildwood.dengine.node

A dtree node.

Public variables and functions:

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.

Public variables and functions:

wildwood.schema

The knowledge representation. This probably ends up looking a bit like a Toulmin schema, where claims are represented as propositions. There also need to be rules or predicates, things which can test whether a given proposition has a given value. There may be other stuff in here.

\ No newline at end of file +Wildwood 0.1.0-SNAPSHOT

Wildwood 0.1.0-SNAPSHOT

Released under the EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0

A general inference library using a game theoretic inference mechanism.

Installation

To install, add the following dependency to your project or build file:

[wildwood "0.1.0-SNAPSHOT"]

Topics

Namespaces

wildwood.advocate

An agent capable of playing the explanation game.

Public variables and functions:

wildwood.bialowieza

The second iteration of the core inference engine for Wildwood

Public variables and functions:

wildwood.caesar

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

wildwood.dengine.engine

An implementation of the DTree engine adapted to wildwood.schema propositions.

Public variables and functions:

wildwood.dengine.node

A dtree node.

Public variables and functions:

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.

Public variables and functions:

wildwood.schema

The knowledge representation. This probably ends up looking a bit like a Toulmin schema, where claims are represented as propositions. There also need to be rules or predicates, things which can test whether a given proposition has a given value. There may be other stuff in here.

\ No newline at end of file diff --git a/docs/codox/wildwood.caesar.html b/docs/codox/wildwood.caesar.html index 366c156..bf9bd7b 100644 --- a/docs/codox/wildwood.caesar.html +++ b/docs/codox/wildwood.caesar.html @@ -1,3 +1,26 @@ -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.

\ No newline at end of file +wildwood.caesar documentation

wildwood.caesar

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

+

The Case Against Marcus Brutus

+

Did Brutus conspire to kill Caesar in the forum in the Ides of March?

+

Falco, the detective, must find out.

+

The witnesses

+

Anthony knows that Brutus is honourable, and that Caesar is buried.

+

Brutus will admit he was in the forum on the ides of March and is a witness that Cassius was also present.

+

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

+

Drusilla believes that Brutus killed Caesar in the Forum on the Ides of March, but was not a witness. She also bears witness that Caesar was buried on the 18th March.

+

Gaius believes that Brutus killed Caesar in the Forum in April, but was not a witness.

+

The rules

+

There is a rule which says that if you kill someone and you have accomplices then you’re not honourable, and a default that has-accomplices is false.

+

Note that has-accomplices boils down to

+
+

For a given verb, object, location and time, there is more than one subject.

+
+

That’s quite sophisticated to represent.

+

There is a rule which says you can’t be killed after you’re dead (temporal reasoning).

+

There is a rule which says if you’ve been killed or been buried then you’re dead.

+

The case against Brutus is based on Drusilla’s claim and on Gaius’s.

+

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.

\ No newline at end of file diff --git a/src/wildwood/caesar.clj b/src/wildwood/caesar.clj index aed3167..a1bd41d 100644 --- a/src/wildwood/caesar.clj +++ b/src/wildwood/caesar.clj @@ -1,13 +1,75 @@ (ns wildwood.caesar "A dummy set of advocates and knowledge accessors with knowledge about the - death of Julius Caesar." + death of Julius Caesar. + + # The Case Against Marcus Brutus + + Did Brutus conspire to kill Caesar in the forum in the Ides of March? + + Falco, the detective, must find out. + + ## The witnesses + + Anthony knows that Brutus is honourable, and that Caesar is buried. + + Brutus will admit he was in the forum on the ides of March and is a witness + that Cassius was also present. + + Cassius and Longus each bear witness that the other killed Caesar in the + Forum on the Ides of March. + + Drusilla believes that Brutus killed Caesar in the Forum on the Ides of + March, but was not a witness. She also bears witness that Caesar was buried + on the 18th March. + + Gaius believes that Brutus killed Caesar in the Forum in April, but was not + a witness. + + ## The rules + + There is a rule which says that if you kill someone and you have accomplices + then you're not honourable, and a default that has-accomplices is false. + + Note that has-accomplices boils down to + > For a given verb, object, location and time, there is more than one subject. + + That's quite sophisticated to represent. + + There is a rule which says you can't be killed after you're dead (temporal + reasoning). + + There is a rule which says if you've been killed or been buried then you're + dead. + + The case against Brutus is based on Drusilla's claim and on Gaius's. + + 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. + " (:require [wildwood.knowledge-accessor :refer [Accessor]] [wildwood.advocate :refer [Advocate]])) + (def ides-of-march "16th March, 44BC" (+ -440000 300 16)) +(def eighteenth-march + "18th March, 44BC" + (+ -440000 300 18)) + (def march "The month of March, 44BC, as a range." (sort [(+ -440000 300 1) (+ -440000 300 30)])) @@ -16,27 +78,49 @@ "The month of April, 44BC, as a range." (sort [(+ -440000 400 1) (+ -440000 400 30)])) +(def anthony-kb + "Mark Antony knows that Brutus is honourable, and that Caesar is buried." + {:brutus [{:verb :is :subject :brutus :object :honourable}] + :caesar [{:verb :bury :subject :calpurnia :object :caesar :date eighteenth-march :nth-hand 1}]}) + +(def brutus-kb + "Brutus will admit that he and Cassius were in the forum in the Ides of March" + {:brutus [{:verb :present :subject :brutus :object :forum :location :forum :date ides-of-march :nth-hand 1}] + :cassius [{:verb :present :subject :cassius :object :forum :location :forum :date ides-of-march :nth-hand 1}] + :forum [{:verb :present :subject :brutus :object :forum :location :forum :date ides-of-march :nth-hand 1} + {:verb :present :subject :cassius :object :forum :location :forum :date ides-of-march :nth-hand 1}]}) + +(def cassius-kb + "Cassius and Longus each bear witness that the other killed Caesar in the + Forum on the Ides of March." + {:caesar [{:verb :kill :subject :longus :object :caesar :location :forum :date ides-of-march :nth-hand 1}] + :longus [{:verb :kill :subject :longus :object :caesar :location :forum :date ides-of-march :nth-hand 1}] + :forum [{:verb :kill :subject :longus :object :caesar :location :forum :date ides-of-march :nth-hand 1}]}) + (def drusila-kb - "Drusila knows that Longus killed Caesar in the forum. She keys it on all three, for efficiency + "Drusila has heard that Brutus killed Caesar in the forum. She keys it on all three, for efficiency of retrieval." - {:caesar [{:verb :killed :subject :longus :object :caesar :location :forum :date ides-of-march}] - :longus [{:verb :killed :subject :longus :object :caesar :location :forum :date ides-of-march}] - :forum [{:verb :killed :subject :longus :object :caesar :location :forum :date ides-of-march}]}) + {:caesar [{:verb :kill :subject :brutus :object :caesar :location :forum :date ides-of-march :nth-hand 2} + {:verb :bury :subject :calpurnia :object :caesar :date eighteenth-march :nth-hand 1}] + :brutus [{:verb :kill :subject :brutus :object :caesar :location :forum :date ides-of-march :nth-hand 2}] + :forum [{:verb :kill :subject :brutus :object :caesar :location :forum :date ides-of-march :nth-hand 2}]}) (def faldo-db - "Falco knows that Caesar has been killed, but doesn't know by whom or when." - {:caesar [{:verb :killed :object :caesar :location :forum}] - :brutus [{:verb :killed :object :caesar :location :forum}] - :forum [{:verb :killed :object :caesar :location :forum}]}) + "Falco believes that Caesar has been killed, but doesn't know by whom or when." + {:caesar [{:verb :kill :object :caesar :location :forum}] + :brutus [{:verb :kill :object :caesar :location :forum}] + :forum [{:verb :kill :object :caesar :location :forum}]}) (def gaius-db - "Gaius knows that Brutus killed Caesar, but believes it happened in April." - {:caesar [{:verb :killed :subject :brutus :object :caesar :location :forum :date april}] - :brutus [{:verb :killed :subject :brutus :object :caesar :location :forum :date april}] - :forum [{:verb :killed :subject :brutus :object :caesar :location :forum :date april}]}) - -(def marc-anthony-kb - "Mark Antony knows that Brutus is honourable." - {:brutus [{:verb :is :subject :brutus :object :honourable}]}) + "Gaius has heard that Brutus killed Caesar, but believes it happened in April." + {:caesar [{:verb :kill :subject :brutus :object :caesar :location :forum :date april :nth-hand 2}] + :brutus [{:verb :kill :subject :brutus :object :caesar :location :forum :date april :nth-hand 2}] + :forum [{:verb :kill :subject :brutus :object :caesar :location :forum :date april :nth-hand 2}]}) +(def longus-kb + "Cassius and Longus each bear witness that the other killed Caesar in the + Forum on the Ides of March." + {:caesar [{:verb :kill :subject :cassius :object :caesar :location :forum :date ides-of-march :nth-hand 1}] + :cassius [{:verb :kill :subject :cassius :object :caesar :location :forum :date ides-of-march :nth-hand 1}] + :forum [{:verb :kill :subject :cassius :object :caesar :location :forum :date ides-of-march :nth-hand 1}]})