Appendix I

Rule-based system: domain operators

 

 

% Meta-locutionary rule-based system -- domain operators

% last rev. 10-21-88

 

%%%%%

%%%%%  Domain-level operators

%%%%%

%

%         goal_confirm_next_subsequence

%         confirmed_next_subsequence

%         confirmed_last_subsequence

%         goal_confirm_next_letter_1

%         goal_confirm_next_letter_2

%         confirmed_next_letter

%         confirmed_last_letter

%         goal_request_next_subsequence

%         obtained_next_subsequence

%         obtained_last_subsequence

%         obtained_next_letter

%         obtained_last_letter

%         goal_assert_next_subsequence

%         asserted_next_subsequence

%         asserted_last_subsequence

%         informed_of_next_subsequence_by_other

%         informed_of_last_subsequence_by_other

%        

 

 

op(       % goal_confirm_next_subsequence

  if([      conversants(Me,Other),

            act(Me,confirm_mutual(sequence(Sequence)),goal_true),

            believe(Me,next_subsequence(subsequence(Index,[L|R])),true) ]),

  not([ act(Me,confirm_mutual(subsequence(Index,[L|R])),goal_true),

            act(Me,assert(believe(Me,subsequence(Index,_),true),Other),goal_true),

            act(Me,assert(believe(Me,subsequence(Index,_),true),Other),true) ]),

  test([ not(L = blank) ]),

  action([]),

  effects([ add(act(Me,confirm_mutual(subsequence(Index,[L|R])),goal_true)),

            add(believe(Me,next_letter(letter(1,L)),true)) ]),

  atts([ level(domain),

            name(goal_confirm_next_subsequence) ]) ).

 

 

op(       % confirmed_next_subsequence

  if([ conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

            believe(Me,next_subsequence(subsequence(Index,List)),true),

            act(Me,confirm_mutual(subsequence(Index,List)),goal_true),

            act(Me,confirm_mutual(next_letter(letter(L_index,Char))),true) ]),

  not([]),

  test([ length(List,Length),

            L_index >= Length,

            get_next_subsequence(Sequence,

                        subsequence(Index,List),

                        subsequence(New_index,New_list)) ]),

  action([ act(Me,confirm_mutual(subsequence(Index,List)),true) ]),

  effects([ del(act(Me,confirm_mutual(subsequence(Index,List)),goal_true)),

            del(act(confirm_mutual(next_letter(letter(L_index,Char))),true)),

            add(believe(Me,next_subsequence(New_index,New_list),true)) ]),

  atts([ level(domain),

            name(confirmed_next_subsequence) ]) ).

 

 

op(       % confirmed_last_subsequence

  if([ conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

            believe(Me,next_subsequence(subsequence(Index,List)),true),

            act(Me,confirm_mutual(subsequence(Index,List)),goal_true),

            act(Me,confirm_mutual(next_letter(letter(L_index,Char))),true) ]),

  not([]),

  test([ length(List,Len1),

            length(Sequence,Len2),

            L_index >= Len1,

            Index + Len1 > Len2 ]),

  action([ act(Me,confirm_mutual(subsequence(Index,List)),true) ]),

  effects([ del(act(Me,confirm_mutual(subsequence(Index,List)),goal_true)),

            del(act(Me,confirm_mutual(next_letter(letter(L_index,Char))),true)) ]),

  atts([ level(domain),

            name(confirmed_last_subsequence) ]) ).

 

 

op(       %  goal_confirm_next_letter_1

  if([ conversants(Me,Other),

    act(Me,confirm_mutual(subsequence(_,_)),goal_true),

    believe(Me,next_letter(Letter),true) ]),

  not([ act(Me,confirm_mutual(next_letter(Letter)),goal_true) ]),

  test([]),

  action([]),

  effects([ add(act(Me,confirm_mutual(next_letter(Letter)),goal_true)),

    add(act(Me,assert(next_letter(Letter),Other),goal_true)) ]),

  atts([ level(domain),

    name(goal_confirm_next_letter_1) ]) ).

 

op(       %  goal_confirm_next_letter_2

  if([ conversants(Me,Other),

    act(Me,confirm_mutual(subsequence(_,_)),goal_true),

    believe(Me,next_letter(Letter),true),

    act(Me,confirm_mutual(next_letter(Other_letter)),goal_true) ]),

  not([ act(Me,confirm_mutual(next_letter(Letter)),goal_true) ]),

  test([ not(Letter = Other_letter) ]),

  action([]),

  effects([ add(act(Me,confirm_mutual(next_letter(Letter)),goal_true)),

    del(act(Me,confirm_mutual(next_letter(Other_letter)),goal_true)),

    add(act(Me,assert(next_letter(Letter),Other),goal_true)) ]),

  atts([ level(domain),

    name(goal_confirm_next_letter_2) ]) ).

 

 

op(       % confirmed_next_letter

  if([ conversants(Me,Other),

    act(Me,confirm_mutual(subsequence(S_index,List)),goal_true),

    act(Me,confirm_mutual(next_letter(letter(Index,Letter))),goal_true),

    believe(Me,next_letter(letter(Index,Letter)),mutually_known_true) ]),

  not([]),

  test([ get_next_letter(Index,List,New_letter) ]),

  actions([]),

  effects([

    del(act(Me,confirm_mutual(next_letter(letter(Index,Letter))),goal_true)),

    add(act(Me,confirm_mutual(next_letter(letter(Index,Letter))),true)),

    del(believe(Me,next_letter(letter(Index,Letter)),mutually_known_true)),

    add(believe(Me,next_letter(New_letter),true)) ]),

  atts([ name(confirmed_next_letter),

    level(domain) ]) ).

 

 

op(       % confirmed_last_letter

  if([ conversants(Me,Other),

    act(Me,confirm_mutual(subsequence(S_index,List)),goal_true),

    act(Me,confirm_mutual(next_letter(letter(Index,Letter))),goal_true),

    believe(Me,next_letter(letter(Index,Letter)),mutually_known_true) ]),

  not([]),

  test([ length(List,Length),

            Index >= Length ]),

  action([]),

  effects([

    del(act(Me,confirm_mutual(next_letter(letter(Index,Letter))),goal_true)),

    add(act(Me,confirm_mutual(next_letter(letter(Index,Letter))),true)),

    del(believe(Me,next_letter(letter(Index,Letter)),mutually_known_true)) ]),

  atts([ name(confirmed_last_letter),

    level(domain) ]) ).

 

 

op(       % goal_request_next_subsequence

  if([ conversants(Me,Other),

    act(Me,confirm_mutual(sequence(Sequence)),goal_true),

    believe(Me,next_subsequence(subsequence(Index,[blank|R])),true) ]),

  not([ act(Me,request(act(Other,assert(subsequence(Index,[blank|R]),Me),

                        goal_true),Other),goal_true),

            act(Me,request(act(Other,assert(subsequence(Index,[blank|R]),Me),

                        goal_true),Other),true) ]),

  test([]),

  action([]),

  effects([

    add(act(Me,request(act(Other,assert(subsequence(Index,[blank|R]),Me),

                        goal_true),Other),goal_true)) ]),

  atts([ level(domain),

    name(goal_request_next_subsequence) ]) ).

 

 

op(       % obtained_next_subsequence

  if([ conversants(Me,Other),

    believe(Me,sequence(Sequence),goal_mutually_known_true),

    believe(Me,next_subsequence(subsequence(Index,List)),true),

    act(Me,request(act(Other,assert(subsequence(Index,List),Me),true),

                        Other),true),

    act(Me,request(act(Other,assert(next_letter(letter(L_index,Char)),Me),

                        true),Other),true) ]),

  not([]),

  test([ length(List,Length),

    L_index >= Length,

    get_next_subsequence(Sequence,

                        subsequence(Index,List),

                        subsequence(New_index,New_list)) ]),

  action([]),

  effects([ del(believe(Me,next_subsequence(subsequence(Index,List)),true)),

    del(act(Me,request(act(Other,assert(subsequence(Index,List),Me),true),

                        Other),true)),

    del(act(Me,request(act(Other,assert(next_letter(letter(L_index,Char)),Me),

                        true),Other),true)),

    add(believe(Me,next_subsequence(New_index,New_list),true)) ]),

  atts([ level(domain),

    name(obtained_next_subsequence) ]) ).

 

 

op(       % obtained_last_subsequence

  if([ conversants(Me,Other),

    believe(Me,sequence(Sequence),goal_mutually_known_true),

    believe(Me,next_subsequence(subsequence(Index,List)),true),

    act(Me,request(act(Other,assert(subsequence(Index,List),Me),true),Other),

                        true),

    act(Me,request(act(Other,assert(next_letter(letter(L_index,Char)),Me),

                        true),Other),true) ]),

  not([]),

  test([ length(List,Len1),

    length(Sequence,Len2),

    L_index >= Len1,

    Index + Len1 >= Len2 ]),

  action([]),

  effects([ del(believe(Me,next_subsequence(subsequence(Index,List)),true)),

    del(act(Me,request(act(Other,assert(subsequence(Index,List),Me),true),

            Other),true)),

    del(act(Me,request(act(Other,assert(next_letter(letter(L_index,Char)),Me),

                        true),Other),true)) ]),

  atts([ level(domain),

    name(obtained_next_subsequence) ]) ).

 

 

op(       % obtained_next_letter

  if([ conversants(Me,Other),

    act(Me,request(act(Other,assert(subsequence(_,List),Me),goal_true),

                        Other),goal_true),

    act(Other,assert(next_letter(letter(Index,Char)),Me),true),

    believe(Me,next_letter(letter(Index,blank)),true),

    believe(Other,next_letter(letter(Index,Char)),true) ]),

  not([]),

  test([ length(List,Length),

    Index < Length,

    New_index is Index + 1 ]),

  action([]),

  effects([

    del(act(Other,assert(next_letter(letter(Index,Char)),Me),true)),

    del(believe(Me,next_letter(letter(Index,blank)),true)),

    del(believe(Other,next_letter(letter(Index,Char)),true)),

    add(believe(Me,next_letter(letter(New_index,blank)),true)) ]),

  atts([ level(domain),

    name(obtained_next_letter) ]) ).

 

 

op(       % obtained_last_letter

  if([ conversants(Me,Other),

    act(Me,request(act(Other,assert(subsequence(_,List),Me),goal_true),

                        Other),goal_true),

    act(Other,assert(next_letter(letter(Index,Char)),Me),true),

    believe(Me,next_letter(letter(Index,blank)),true),

    believe(Other,next_letter(letter(Index,Char)),true) ]),

  not([]),

  test([ length(List,Length),

            Index >= Length ]),

  action([]),

  effects([

    del(act(Other,assert(next_letter(letter(Index,Char)),Me),true)),

    del(believe(Me,next_letter(letter(Index,blank)),true)),

    del(believe(Other,next_letter(letter(Index,Char)),true)) ]),

  atts([ level(domain),

    name(obtained_last_letter) ]) ).

 

 

op(       % goal_assert_next_subsequence_1

  if([      conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

        act(Other,request(act(Me,assert(subsequence(Index,[blank|Rest]),Other),

                        goal_true),Me),true),

            believe(Me,next_subsequence(subsequence(Old_Index,Letters)),true) ]),

  not([ act(Me,assert(believe(Me,New_subseq,true),Other),goal_true),

                        act(Me,confirm_mutual(subsequence(Index,_)),goal_true) ]),

  test([ get_subsequence(Index,sequence(Sequence),New_subseq) ]),

  action([]),

  effects([ del(act(Other,request(act(Me,assert(subsequence(Index,

                        [blank|Rest]),Other),goal_true),Me),true)),

            add(act(Me,assert(believe(Me,New_subseq,true),Other),goal_true)),

            del(believe(Me,next_subsequence(subsequence(Old_Index,Letters)),true)),

            add(believe(Me,next_subsequence(New_subseq), true)) ]),

  atts([ level(domain),

            name(goal_assert_next_subsequence_1) ]) ).

 

 

op(       % goal_assert_next_subsequence_2

  if([      conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

        act(Other,request(act(Me,assert(subsequence(Index,[blank|Rest]),Other),

                        goal_true),Me),true),

            act(Me,confirm_mutual(subsequence(Index,_)),goal_true),

            act(Me,confirm_mutual(next_letter(Letter)),goal_true),

            act(Me,assert(next_letter(Letter),Other),goal_true),

            believe(Me,next_subsequence(subsequence(Old_Index,Letters)),true) ]),

  not([ act(Me,assert(believe(Me,New_subseq,true),Other),goal_true) ]),

  test([ get_subsequence(Index,sequence(Sequence),New_subseq) ]),

  action([]),

  effects([ del(act(Other,request(act(Me,assert(subsequence(Index,

                        [blank|Rest]),Other),goal_true),Me),true)),

            del(act(Me,confirm_mutual(subsequence(Index,_)),goal_true)),

            del(act(Me,confirm_mutual(next_letter(Letter)),goal_true)),

            del(act(Me,assert(next_letter(Letter),Other),goal_true)),

            add(act(Me,assert(believe(Me,New_subseq,true),Other),goal_true)),

            del(believe(Me,next_subsequence(subsequence(Old_Index,Letters)),true)),

            add(believe(Me,next_subsequence(New_subseq), true)) ]),

  atts([ level(domain),

            name(goal_assert_next_subsequence_2) ]) ).

 

 

op(       % asserted_next_subsequence

  if([ conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

            believe(Me,next_subsequence(subsequence(Index,List)),true),

            act(Me,assert(believe(Me,subsequence(Index,List),true),Other),true) ]),

  not([]),

  test([ length(List,Len1),

            length(Sequence,Len2),

            Index + Len1 =< Len2,

            get_next_subsequence(Sequence,

                        subsequence(Index,List),

                        subsequence(Next_index,Next_list)) ]),

  action([]),

  effects([ del(believe(Me,next_subsequence(subsequence(Index,List)),true)),

            del(act(Me,assert(believe(Me,subsequence(Index,List),true),Other),

                        true)),

            add(believe(Me,next_subsequence(subsequence(Next_index,Next_list)),

                        true)) ]),

  atts([ level(domain),

            name(asserted_next_subsequence) ]) ).

 

 

op(       % asserted_last_subsequence

  if([ conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

            believe(Me,next_subsequence(subsequence(Index,List)),true),

            act(Me,assert(believe(Me,subsequence(Index,List),true),Other),true) ]),

  not([]),

  test([ length(List,Len1),

            length(Sequence,Len2),

            Index + Len1 > Len2 ]),

  action([]),

  effects([ del(believe(Me,sequence(Sequence),goal_mutually_known_true)),

            add(believe(Me,sequence(Sequence),mutually_known_true)),

            del(believe(Me,next_subsequence(subsequence(Index,List)),true)),

            del(act(Me,assert(believe(Me,subsequence(Index,List),true),Other),

                        true)) ]),

  atts([ level(domain),

            name(asserted_last_subsequence) ]) ).

 

op(       % informed_of_next_subsequence_by_other

  if([ conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

            believe(Me,next_subsequence(subsequence(Index,[blank|Rest])),true),

            act(Other,assert(believe(Other,subsequence(Index,List),true),Me),

                        true) ]),

  not([]),

  test([ length([blank|Rest],Len1),

            length(Sequence,Len2),

            Index + Len1 =< Len2,

            get_next_subsequence(Sequence,

                        subsequence(Index,[blank|Rest]),

                        subsequence(Next_index,Next_list)) ]),

  action([]),

  effects([ del(believe(Me,next_subsequence(subsequence(Index,[blank|Rest])),

                        true)),

            del(act(Other,assert(believe(Other,subsequence(Index,List),true),Me),

                        true)),

            add(believe(Me,next_subsequence(subsequence(Next_index,Next_list)),

                        true)) ]),

  atts([ level(domain),

            name(informed_of_next_subsequence_by_other) ]) ).

 

 

op(       % informed_of_last_subsequence_by_other

  if([ conversants(Me,Other),

            believe(Me,sequence(Sequence),goal_mutually_known_true),

            believe(Me,next_subsequence(subsequence(Index,[blank|Rest])),true),

            act(Other,assert(believe(Other,subsequence(Index,List),true),Me),

                        true) ]),

  not([]),

  test([ length([blank|Rest],Len1),

            length(Sequence,Len2),

            Index + Len1 > Len2 ]),

  action([]),

  effects([ del(believe(Me,sequence(Sequence),goal_mutually_known_true)),

            add(believe(Me,sequence(Sequence),mutually_known_true)),

            del(believe(Me,next_subsequence(subsequence(Index,[blank|rest])),

                        true)),

            del(act(Other,assert(believe(Other,subsequence(Index,List),true),Me),

                        true)) ]),

  atts([ level(domain),

            name(informed_of_last_subsequence_by_other) ]) ).