PROJECT TITLE: OscarReloaded

PURPOSE OF PROJECT: illustrate non-deductive and deductive reasoning in a web of beliefs,
following ideas developed in John Pollock's "Cognitive Carpentry" approach to implement
an artificial non-deductive reasoning agent.

VERSION or DATE: DEC 2014 - JAN 2015

HOW TO START THIS PROJECT: the whole collection of classes is usable in the BlueJ-environment,
    by using the file: package.bluej
    One can start one's exploration from the class [ReasoningModule] and proceed to the other
    classes, which are used here.

AUTHORS:    Manuel Bremer (www.mbph.de), 
            starting from the ideas behind John Pollocks artelect project 'Oscar'
            cf. Pollock's book 'Cognitive Carpentry' (MIT Press, 1995).
            cf. http://johnpollock.us/ftp/OSCAR-web-page/oscar.html

USER INSTRUCTIONS:

0. These user instructions show how design choices and the inherent necessities coming with a
programming language's structure influence the implementation. It should be obvious that the
purpose of this programming exercise is not to provide a running or even a debugged version of 
an automatic non-deductive reasoner, but to illustrate the structure and especially the procedures
that might model especially non-deductive reasoning or at least stimulate further model
building concerning it.

1. Sentence are written in a bracketless list notation.
    Examples:   IsRed table
                Expensive liquer
                Like peter paula
                Buy george book
                
2. Sentences are either predicate [e.g. "IsRed table"], relational with two or three arguments 
[e.g. "Buy peter book" or "Give peter book paul"], or logically complex.

3. Weights of edges and strength of sentences are normalized,
    for strength 0 <= x <= 1
    for edges the part x of the double coding the strength 0 <= x <= 0.9999 
    (as the next double codes another type).
    Inputs are - at least at first - beyond doubt and given maximal strength.
    
4. Edges are of tyes:
    0 - no relation
    1 - deductive inference
    2 - prima facie rule
    3 - default/statistical inference
    4 - defeat (not necessarily symmetric); entailing the negation is a deductive link.
The strength of the links decreases with a higher integer-part of the value! Given two links with the same 
integer value the stronger link is computed by comparing the decimal part of the strength.

5. Assumptions are those used in default or generally non-monotonic reasoning [e.g. "NOT Penguin tweety"
to derive "Fly tweety" from "Bird tweety"]. 
If one of the assumptions is shown to be false, the node is defeated. Defaults are 'normal defaults', i.e.
the conclusion is adopted until proven to be false, i.e. it is added to the assumption list of a respective
added node.

6. To avoid brackets complex sentences are written in Polish notation [e.g. "NOT AND IsRed table IsGreen book"]

7. Prima facie rules employ quasi-conceptual connections between predicates/relations. Thus if two expressions
are linked by such a rule they share their syntactic frame (esp. number of argument terms). For example "LooksRed
table" prima facie implies "Red table". To keep the order of arguments one has to express the rules in the fashion
of "Kiss paul paula" prima facie implies "LovedBy paul paula".

8. If we proceed from a conditional probability "PROB Fly Bird 0.8" to a conditional we have to introduce variables:
"IMP Bird var Fly var".

9. Some constructions of Pollock's approach to theoretical reasoning are not (yet) incorporated here:
    - partial assignments of defeat status
    - collect defeat is covered in as much as it results from mutual defeat links
    - Pollock's distinction between outright and provisional defeat is captured only to the effect that outright
      defeated nodes (i.e. self-defeaters) will never be re-instated and are removed from the inference graph;
      for all other nodes the model here allows for edges to a node from different arguments (one node being 
      addable because of several arguments), so that reasoning from this node (Pollock's 'flagged' reasoning)
      makes sense as long as one of (set of) incoming edges is viable (i.e. not a case of outright defeat).
        
10. Some reasoning processes are implemented here only for simple syntactic cases 
(to postpone the further details of syntactic analysis in case of complex sentences). 
These include:
    - statistical inference, method [statisticalDetachment]
    - direct inferences, method [directInference] 
    - Baysian detachment ('conditionalization'), method [baysianDetachment]
    - sub-property defeat, method [subPropertyDefeaterForNode]
 
11. The method [pursueEpistemicInterests] needs to identify the type of inference made to add an appropriate edge to
the graph. Therefore [ItemsOfInterest] come with a type, which should suit the needed antecedent statements 
accociated with them. We assume that the user matches type and the set of the needed antecedents! Further on, we assume
that the antecedent set contains sentences only (i.e. not sets of sentences). This works well with prima facie rules and
statistical inference, but poses a problem for deductive rules which reduce the set of suppositions (like conditionalization).

12. If a node is deleted from the inference graph, the gap is filled by an arbitrary tautology to avoid [null] content
in the inference graph. The number of nodes does not decrease. [This is just a technical convenience.]

13. For sub-property defeat we assume that the status of being a subproperty is an intensional status mirrored by a
meaning postulate. We also assume that a node has only one derivation by statistical inference (i.e. is not derived 
twice over by statistical inference, which seems unlikely given the metaphysical background theory).

14. Components excluded by Pollock's original approach or desiderata are also not incorporated here. This includes:
    - projectibility (as to be used in objective probability and sub-property defeaters)
    - inference to the best explanation (in as much as it is more than reasoning by Dilemma)
    - associative reasoning
    
15. The implementation here mainly deals with theoretical reasoning. Of course the purpose of much of (this) reasoning
is to support decisions and actions based upon them. The more realistic the modelling becomes here the more cognitive
instances/structures have to be integrated.

16. Q&I-modules are taken as a form of input, because they are cognitively penetrable.

17. Although Pollock stresses the role of self-monitoring and reflexive cognition their logical structure and procedural
implementation are open questions. Especially what should trigger their activiation is linked to the problem of when to
interrupt the reasoning loop.











    



