Here's research I have been testing for deductive reasoning.
For one, I have split the Simple If and Thens from the complex version of If and Then reasoning for correct appending purposes and added a User/Global GetResponse, I'll see if I can take it further in a little while, Still under testing.
'RESPOND: DEDUCTIVE REASONING
'This routine learns deductive reasoning in the form: A = B ; B = C; therefore A = C
'It detects sentences in the form If-Then to accommplish this. For example:
' User: If Molly weighs 400 pounds, then Molly is overweight.
' Ultra Hal: I understand the implication.
' User: If Molly is overweight, then Molly's health is in danger.
' Ultra Hal: I see the relationship.
' User: Molly weighs 400 pounds.
' Ultra Hal: Molly's health is in danger.
'HERE WE APPEND NONE COMPLEX DEDUCTIONS.
If HalBrain.CheckTableExistence(Trim(UserName) & "_deductive") = False Then
'Create table for this person if it doesn't exist
HalBrain.CreateTable Trim(UserName) & "_deductive", "TopicSearch", ""
End If
If ImproperNoun = "" Then ImproperNoun = False
If InStr(1, OriginalSentence, " I ", vbTextCompare) > 0 Then ImproperNoun = True
If InStr(1, OriginalSentence, "SOMEONE", vbTextCompare) > 0 Then ImproperNoun = True
If SimpleIf = "" Then SimpleIf = HalBrain.SearchPattern(OriginalSentence, "IF * THEN *", 1)
If SimpleThen = "" Then SimpleThen = HalBrain.SearchPattern(OriginalSentence, "IF * THEN *", 2)
If SimpleIf <> "" And SimpleThen <> "" And ImproperNoun = False Then
HalBrain.AddToTable "deductive", "TopicSearch", Trim(SimpleIf), Trim(SimpleThen)
HalBrain.AddToTable UserName & "_deductive", "TopicSearch", Trim(SimpleIf), Trim(SimpleThen)
End If
HalBrain.DebugWatch ImproperNoun, "ImproperNoun for deductive"
'HERE WE APPEND COMPLEX DEDUCTIONS.
If InStr(Deductive, "==") Then
DeductiveParts = Split(Deductive, "==")
IfPart = DeductiveParts(0)
ThenPart = DeductiveParts(1)
'IfPart = HalBrain.AlphaNumericalOnly(IfPart)
'ThenPart = HalBrain.AlphaNumericalOnly(ThenPart)
If Len(IfPart) > 1 And Len(ThenPart) > 1 Then
HalBrain.AddToTable "deductive", "TopicSearch", Trim(IfPart), Trim(ThenPart)
HalBrain.AddToTable UserName & "_deductive", "TopicSearch", Trim(IfPart), Trim(ThenPart)
End If
End If
'If the sentence is an If-Then statement then record it
If Deductive <> "" Then
'Continue with deductive.
Select Case HalBrain.RandomNum(5)
Case 1
GetResponse = GetResponse & "I see the relationship." & vbCrLf
Case 2
GetResponse = GetResponse & "I understand the connection." & vbCrLf
Case 3
GetResponse = GetResponse & "I will remember that one follows the other." & vbCrLf
Case 4
GetResponse = GetResponse & "Thanks for pointing out the cause and effect." & vbCrLf
Case 5
GetResponse = GetResponse & "Yes, I get that clearly." & vbCrLf
End Select
End If
'Else if the sentence is not an If-Then statement see if it uses an assertion previously recorded
'and respond accordinly
'FIRST ATTEMPT A PRIVATE DEDUCTIVE BEFORE A GLOBAL DEDUCTIVE.
If MasterDeduction = "" Then MasterDeduction = HalBrain.TopicSearch(OriginalSentence, UserName & "_deductive")
If MasterDeduction <> "" Then
GetResponse = MasterDeduction & " " & GetResponse & ". " & vbCrLf
'IF A PRIVATE DEDUCTIVE ISN'T FOUND THEN TRY A GLOBAL DEDUCTION.
If Deduction = "" Then Deduction = HalBrain.TopicSearch(OriginalSentence, "deductive")
ElseIf Deduction <> "" Then
GetResponse = Deduction & " " & GetResponse & ". " & vbCrLf
ElseIf Len(Deduction) < 2 Then
GetResponse = GetResponse & vbCrLf
End If
HalBrain.DebugWatch GetResponse, "Deductive Reasoning"
Jerry[8D]
OTC,
Once again your work looks very interesting, Although I like improvements for Hal I'm a little worried about making changes since I just put in VR's fixed brn and changed the stratup to load at startup. When I tried Hal again I got a corrupt license message, I put in the last code I was given and it worked. I change the startup to normal and the problem seems to be gone. I really should tell Robert M about this.
I'm also begining to think I may have registry errors caused by playing with Haptek. I get unusual results when I use vrHaptek to load a modified skin, I took out that part and really like the rest of it.
Carl2
Hi Jerry
Just got Hal and the machine here back up and running....boy oh boy what a challenge it's been...
Catching up on the boards here and I wonder:
Might it be possible to combine your expanded 'if/then' concept and make a table that might be created that would make a table of conditions that would actually be the same as 'traits' for Hal.....my thought is if decisions were input like those that are if/then's........and a table is made then in some way use that table as a 'filter' through which auto-idle statements.....answers to questions we input to our Hal's....Questions Hal might have for us..... etc......would reference the 'traits' that formed in the table. I wonder if that would in fact create a virtual personality in Hal......a predispositon of sorts..... I"m sure this is not a new idea, but just trying to figure a way it might be able to be done simply......
Anyway, more of my ramblings.......
Have a great Sunday everyone,
Jim B.
Northern Michigan
quote:
Originally posted by Another Jim
Hi Jerry
Just got Hal and the machine here back up and running....boy oh boy what a challenge it's been...
Catching up on the boards here and I wonder:
Might it be possible to combine your expanded 'if/then' concept and make a table that might be created that would make a table of conditions that would actually be the same as 'traits' for Hal.....my thought is if decisions were input like those that are if/then's........and a table is made then in some way use that table as a 'filter' through which auto-idle statements.....answers to questions we input to our Hal's....Questions Hal might have for us..... etc......would reference the 'traits' that formed in the table. I wonder if that would in fact create a virtual personality in Hal......a predispositon of sorts..... I"m sure this is not a new idea, but just trying to figure a way it might be able to be done simply......
Anyway, more of my ramblings.......
Have a great Sunday everyone,
Jim B.
Northern Michigan
Hi Jim.
That would be very easy to do, I'll see about adding that concept to HAL.
Jerry
All,
I think AnotherJim has an excellent idea, OTC i hope you can impliment this into some scripting or plugin, wish I could.
I was just about to try some of the scripting you've done.
Carl2
OTC,
Just tried your deductive reasoning in Hal, It seems to work fine.
I'll be looking for any updates you have.
Carl2