Information Technology Reference
In-Depth Information
Fig. 3.5
The function abduce at top level
that will use experience, we need a
memory
of some sort. If we include memory then
we will finally have a primitive construct of all the elements of an intelligent system
as seen in Fig.
3.6
.
The function '
add_idea
' uses a parameter as a memory shown in Fig.
3.7
QUERY
>
add_idea []
[[
xor
(isnot iseven) isvowel ] ]
QUERY
>
add_idea [ [ xor (isnot iseven) isvowel ] ]
[[
&&
(isnot iseven) (isnot isvowel) ]
[
xor
(isnot iseven) isvowel ] ]
QUERY
>
add_idea[[&&(isnot iseven) (isnot isvowel) ] [ xor (isnot iseven) isvowel ]
]
[[
&&
(isa "char") iseven ]
[
&&
(isnot iseven) (isnot isvowel) ]
[
xor
(isnot iseven) isvowel ] ]
The function 'getRule' (see Fig.
3.8
) uses add_idea, which calls 'abduce' to add a
single new hypothesis to a growing list of hypotheses saved in its parameter. The
function 'get_rule' always gives the latest hypothesis (function '
head
').
The function '
getRule
' is then used by '
giveR4S
' to generate new rules for testing
as in Fig.
3.9
. The testing involves the principles used in the function '
confirmTF
'
described in Fig.
3.3
.
QUERY
>
giveR4S [ ['a' #6] [ 'd' #2 ] ['e' #4]['c'#7]]['a''d'#4#7]
Would '
even OR consonant
' be a good rule to try?
Yes, try this rule
...
'
even OR consonant
'
Only these cards need be checked
...
[a7]
Both sides of the checked cards:-
[[a6][c7]]