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
   18
   19
   20rule_set(RuleSet,MaxRuleID):-
   21  MaxRuleID = 7,
   22  RuleSet = [
   23    [1,def_father_1,[-[child,Y,X],-[male,X],+[father,X,Y]]],
   24    [2,def_mother_1,[-[child,Y,X],-[female,X],+[mother,X,Y]]],
   25    [3,def_parent_1,[-[father,X,Y],+[parent,X,Y]]],
   26    [4,def_parent_2,[-[mother,X,Y],+[parent,X,Y]]],
   27    [5,fact_lucy_1,[+[female,lucy]]],
   28    [6,fact_alice_1,[+[child,alice,bob]]],
   29    [7,fact_bob_1,[+[child,bob,lucy]]]
   30  ].
   31
   32symbol_set(SymbolSet,MaxSymbolID):-
   33  MaxSymbolID = 10,
   34  SymbolSet = [
   35    [1,vble],[2,father],[3,child],[4,male],[5,female],
   36    [6,parent],[7,lucy],[8,alice],[9,bob],[10,mother]
   37  ].
   38
   39
   40nnet_definition(NNet):-
   41  InDim = 70,
   42  HidDim = 32,
   43  OutDim = 7,
   44  layer_init(layer1,InDim,HidDim,relu,[-0.2,0.2]),
   45  layer_init(layer2,HidDim,HidDim,relu,[-0.2,0.2]),
   46  layer_init(layer3,HidDim,HidDim,relu,[-0.2,0.2]),
   47  layer_init(layer4,HidDim,HidDim,relu,[-0.2,0.2]),
   48  layer_init(layer5,HidDim,HidDim,relu,[-0.2,0.2]),
   49  layer_init(layer6,HidDim,OutDim,softmax,[-0.2,0.2]),
   50  NNet = [layer1,layer2,layer3,layer4,layer5,layer6].
   51
   52run_main:-
   53  init_search_time,
   54  nnet_definition(NNet),
   55  rule_set(RS,NR),
   56  symbol_set(SS,NS),
   57  LM = method(learning(100,0.01),input(2,2),output(7)),
   58  RM = method(reasoning,input(2,2),output(7)),
   59  G1 = [-[female,lucy]],
   60  dnn_sl_resolution(G1,[RS,NR],[SS,NS],NNet,LM,100,_),
   61  G2 = [-[mother,lucy,bob]],
   62  dnn_sl_resolution(G2,[RS,NR],[SS,NS],NNet,LM,100,_),
   63  G3 = [-[mother,lucy,bob],-[female,lucy]],
   64  dnn_sl_resolution(G3,[RS,NR],[SS,NS],NNet,LM,100,_),
   65  G4 = [-[parent,lucy,bob]],
   66  dnn_sl_resolution(G4,[RS,NR],[SS,NS],NNet,RM,100,Path4),
   67  nl,print_by_line(Path4),nl.
   68
   69
   70
   71   re_enumerate_goals_as_stated(from_users,UserGoals),
   72   expand_to_other_implicit_goals(UserGoals,UserGoalsAll),
   73
   74
   75
   76_by_users
   77re_enumerate_agent_goals
   78expand_to_other_implicit_goals
   79
   80observe_objectively
   81observe_subjectively
   82
   83paraphrase objectively
   84paraphrase subjectively
   85
   86rationalize objectively
   87rationalize subjectively
   88
   89accomidate subjectively
   90accomidate objectively
   91
   92
   93Self-reaction - Reactions to one�s performance can be motivating.
   94If 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.
   95A negative self evaluation may also be motivating in that one may desire to work harder providing that they consider the goal as valuable.
   96Self reaction also allows a person to re-evaluate their goals in conjunction with their attainments (Bandura, 1989).
   97If 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.
   98Self-efficacy - One�s belief in the likelihood of goal completion can be motivating in itself.
   99The 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.
  100rationalize: 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.
  101observe accomidate One contribution of rationalization theory is that it implies additional logical restrictions on psychological constraints.
  102We 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.
  103Moreover, 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.
  104As a result, rationalization theory allows conclusive inferences about preferences even when psychological constraints are entirely unobservable.
  105Basic rationalization theory allows a conclusive inference of preference follows only from a violation of WARP.
  106It is precisely when standard theory leads to a contradictory inference of preferences that rationalization theory leads to a conclusive inference of preference.
  107Further inferences are possible if preferences are assumed to be orders.
  108In that case it is sometimes possible to uniquely determine a preference order even in the presence of multiple violations of WARP.
  109In the appendix we provide a list of observed anomalies which may be consistent with rationalization theory.
  110Returning to the example of Synder�s discrimination study, we show that rationalization theory alone is insufficient to permit the inference of handicapped aversion.
  111We 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.
  112Specifically, 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.
  113Hence, even partial knowledge of rationales can provide additional insight into preferences.
  114We fully characterize the inferences of preferences that must follow from rationalization theory aided by ad-hoc provisos on psychological constraints.
  115In a discussion section following the presentation of formal results we discuss potential methods for ascertaining information about agent�s rationales 
  116
  117