2:-module(agent,[]).    3
    4
    5toploop(UserOrSelf):- 
    6  re_enumerate_agent_goals(UserOrSelf,Goals),
    7  expand_to_other_implicit_goals(UserOrSelf,Goals,GoalsAll),
    8  get_previous__goals(UserOrSelf,PrevGoals),
    9  divide(GoalsAll,PrevGoals,NoLonger,Continued,New),
   10  why_goal_satisfied(UserOrSelf,NoLonger,WhyNoLonger),
   11  preconds_of_goals(UserOrSelf,Continued,ContinuedPreconds),
   12  preconds_of_goals(UserOrSelf,New,NewPreconds),
   13  divide(ContinuedPreconds,NewPreconds,NoLongerPrecond,PrecondsStillNeeded,ActualNewPreconds),
   14  note(predconds_still_needed(UserOrSelf,PrecondsStillNeeded)),
   15  note(released_preconds(UserOrSelf,NoLongerPrecond)),
   16  note(add_req_preconds(UserOrSelf,ActualNewPreconds)),!.
   17
   18toploop(UserOrSelf):- 
   19  re_enumerate_agent_goals(UserOrSelf,Goals),
   20  expand_to_other_implicit_goals(UserOrSelf,Goals,GoalsAll),
   21  get_previous__goals(UserOrSelf,PrevGoals),
   22  divide(GoalsAll,PrevGoals,NoLonger,Continued,New),
   23  why_goal_satisfied(UserOrSelf,NoLonger,WhyNoLonger),
   24  preconds_of_goals(UserOrSelf,Continued,ContinuedPreconds),
   25  preconds_of_goals(UserOrSelf,New,NewPreconds),
   26  divide(ContinuedPreconds,NewPreconds,NoLongerPrecond,PrecondsStillNeeded,ActualNewPreconds),
   27  note(predconds_still_needed(UserOrSelf,PrecondsStillNeeded)),
   28  note(released_preconds(UserOrSelf,NoLongerPrecond)),
   29  note(add_req_preconds(UserOrSelf,ActualNewPreconds)),!.
   30
   31
   32
   33rule_set(RuleSet,MaxRuleID):-
   34  MaxRuleID = 7,
   35  RuleSet = [
   36    [1,def_father_1,[-[child,Y,X],-[male,X],+[father,X,Y]]],
   37    [2,def_mother_1,[-[child,Y,X],-[female,X],+[mother,X,Y]]],
   38    [3,def_parent_1,[-[father,X,Y],+[parent,X,Y]]],
   39    [4,def_parent_2,[-[mother,X,Y],+[parent,X,Y]]],
   40    [5,fact_lucy_1,[+[female,lucy]]],
   41    [6,fact_alice_1,[+[child,alice,bob]]],
   42    [7,fact_bob_1,[+[child,bob,lucy]]]
   43  ].
   44
   45symbol_set(SymbolSet,MaxSymbolID):-
   46  MaxSymbolID = 10,
   47  SymbolSet = [
   48    [1,vble],[2,father],[3,child],[4,male],[5,female],
   49    [6,parent],[7,lucy],[8,alice],[9,bob],[10,mother]
   50  ].
   51
   52
   53nnet_definition(NNet):-
   54  InDim = 70,
   55  HidDim = 32,
   56  OutDim = 7,
   57  layer_init(layer1,InDim,HidDim,relu,[-0.2,0.2]),
   58  layer_init(layer2,HidDim,HidDim,relu,[-0.2,0.2]),
   59  layer_init(layer3,HidDim,HidDim,relu,[-0.2,0.2]),
   60  layer_init(layer4,HidDim,HidDim,relu,[-0.2,0.2]),
   61  layer_init(layer5,HidDim,HidDim,relu,[-0.2,0.2]),
   62  layer_init(layer6,HidDim,OutDim,softmax,[-0.2,0.2]),
   63  NNet = [layer1,layer2,layer3,layer4,layer5,layer6].
   64
   65run_main:-
   66  init_search_time,
   67  nnet_definition(NNet),
   68  rule_set(RS,NR),
   69  symbol_set(SS,NS),
   70  LM = method(learning(100,0.01),input(2,2),output(7)),
   71  RM = method(reasoning,input(2,2),output(7)),
   72  G1 = [-[female,lucy]],
   73  dnn_sl_resolution(G1,[RS,NR],[SS,NS],NNet,LM,100,_),
   74  G2 = [-[mother,lucy,bob]],
   75  dnn_sl_resolution(G2,[RS,NR],[SS,NS],NNet,LM,100,_),
   76  G3 = [-[mother,lucy,bob],-[female,lucy]],
   77  dnn_sl_resolution(G3,[RS,NR],[SS,NS],NNet,LM,100,_),
   78  G4 = [-[parent,lucy,bob]],
   79  dnn_sl_resolution(G4,[RS,NR],[SS,NS],NNet,RM,100,Path4),
   80  nl,print_by_line(Path4),nl.
   81
   82
   83
   84   re_enumerate_goals_as_stated(from_users,UserGoals),
   85   expand_to_other_implicit_goals(UserGoals,UserGoalsAll),
   86
   87
   88
   89_by_users
   90re_enumerate_agent_goals
   91expand_to_other_implicit_goals
   92
   93observe_objectively
   94observe_subjectively
   95
   96paraphrase objectively
   97paraphrase subjectively
   98
   99rationalize objectively
  100rationalize subjectively
  101
  102accomidate subjectively
  103accomidate objectively
  104
  105
  106Self-reaction - Reactions to one�s performance can be motivating.
  107If progress is deemed acceptable, then one will have a feeling of self-efficacy with regards to continuing, and will be motivated towards the achievement of their goal.
  108A negative self evaluation may also be motivating in that one may desire to work harder providing that they consider the goal as valuable.
  109Self reaction also allows a person to re-evaluate their goals in conjunction with their attainments (Bandura, 1989).
  110If a person has achieved a goal, they are likely to re-evaluate and raise the standard (goal); whereas, if a person has not achieved the goal they are likely to re-evaluate and lower the standard (goal) to an achievable goal.
  111Self-efficacy - One�s belief in the likelihood of goal completion can be motivating in itself.
  112The idea of self-efficacy has received the most attention from scholars and researchers and thus will be the primary topic of this wiki page and will be discussed in more detail in the section.
  113rationalize: attempt to explain or justify (one's own or another's behavior or attitude) with logical, plausible reasons, even if these are not true or appropriate.
  114observe accomidate One contribution of rationalization theory is that it implies additional logical restrictions on psychological constraints.
  115We show that rationalization theory implies that if an alternative is psychologically feasible in a superset then it must also be feasible in any subset that contains it.
  116Moreover, any specification of psychological constraints that satisfies this property can be generated as the consequence off some appropriately selected set of rationales that are asymmetric and transitive.
  117As a result, rationalization theory allows conclusive inferences about preferences even when psychological constraints are entirely unobservable.
  118Basic rationalization theory allows a conclusive inference of preference follows only from a violation of WARP.
  119It is precisely when standard theory leads to a contradictory inference of preferences that rationalization theory leads to a conclusive inference of preference.
  120Further inferences are possible if preferences are assumed to be orders.
  121In that case it is sometimes possible to uniquely determine a preference order even in the presence of multiple violations of WARP.
  122In the appendix we provide a list of observed anomalies which may be consistent with rationalization theory.
  123Returning to the example of Synder�s discrimination study, we show that rationalization theory alone is insufficient to permit the inference of handicapped aversion.
  124We show that the inference of handicapped aversion requires not only the assumption that decision makers have preference orders but also some specific ad hoc assumptions about what choices Dee can rationalize.
  125Specifically, it requires the ad-hoc (but natural) assumption that Dee can rationalize watching movie 1 with a person in a wheelchair rather than watching movie 2 alone.
  126Hence, even partial knowledge of rationales can provide additional insight into preferences.
  127We fully characterize the inferences of preferences that must follow from rationalization theory aided by ad-hoc provisos on psychological constraints.
  128In a discussion section following the presentation of formal results we discuss potential methods for ascertaining information about agent�s rationales 
  129
  130