001 (ns wildwood.bialowieza
002 "The second iteration of the core inference engine for Wildwood"
003 (:require [wildwood.advocate :refer [Advocate]]
004 [wildwood.schema :refer [proposition?]]))
005
006 ;; to start a game we must have n advocates, where n > 1. Each must have
007 ;; its own knowledge accessor, so at the level of the game engine we don't
008 ;; need to know how to access knowledge.
009
010 (defn decide
011 "Decide the truth value of this `proposition` by convening a game between
012 these advocate `agents`. Iterate the game until all agents PASS; then finally
013 offer each agent's `record` method the `proposition` together with the
014 decided truth value (`true` or `false`), before returning that value.
015
016 The `proposition` is a proposition as defined in the `wildwood.schema`;
017 that is to say, the predicate `wildwood.schema/predicate?` returns true
018 of it. If the proposition isn't a predicate, throw an exception.
019
020 Each of `agents` should be an object implementing the
021 `wildwood.advocate/Advocate` protocol. If an agent isn't an Advocate,
022 throw an exception.
023
024 Do not throw an exception under any other circumstances.
025
026 If an agent throws an exception, catch it and treat it as a PASS."
027 [proposition & agents]
028 ;; TODO: actually write it.
029
030 false)