lecture three-metaphor__ 1098-1
- 格式:ppt
- 大小:428.00 KB
- 文档页数:36
月考试卷(1~4单元)2024-2025学年人教版数学三年级上册时间:60分钟,满分:100分一、选择题(每题2分,共12分)1.从杭州乘坐高铁到北京,大约需要 6( )。
A.小时B.分钟C.秒2.一头大象的质量是4( )。
A.千克B.吨C.克3.在钟面上,秒针从 12 走到 10 ,经过了( )。
A.2 秒B.50 秒C.50 分4.204+548的和大约是( )。
A.770B.750C.7005.一支铅笔原来长2分米,用去了1厘米,还剩( )。
A.1分米B.10厘米C.19厘米6.最大的三位数与最小的三位数的和是( )。
A.899B.1098C.1099二、判断题(每题1分,共6分)7.秒针走1圈是60秒,分针走1圈是60分。
( )8.一个数减去240后是500,这个数是260。
( )9.相邻两个长度单位之间的进率都是10。
( )10.2吨石头比2000千克棉花重。
( )11.万以内的加减法和百以内的加减法的计算法则是一样的。
( )12.一件电风扇245元,一件电饭煲187元,妈妈带400元不够买这两件商品。
( )三、填空题(每空1分,共22分)13.在横线上填上合适的单位名称。
学校组织运动会,小红跑800米需要5 ,立定跳远跳了15 。
一辆货车载质量是5 ,每小时行驶45 。
14.学校体育老师对第一小组同学进行50米测试,成绩如下:小明用时9秒,小红11秒,小恽8秒,小兰10秒。
跑得最快, 跑得最慢。
15.在横线里填上合适的数。
①6吨= 千克②3000米= 千米③2分30秒= 秒④7吨500千克= 千克⑤4千米+200米= 米⑥2分米﹣8厘米= 厘米16.估算307+297时,把307看作 ,把297看作 ,估算结果是 。
17. 比436多98, 比364少190。
18.小桂在“文化演讲”活动中,介绍了河南博物馆的几种文物,其中对“贾湖骨笛”感兴趣的有347人,对“云纹铜禁”感兴趣的比对“贾湖骨笛”感兴趣的多51人,对“贾湖骨笛”和“云纹铜禁”感兴趣的大约一共有 人。
2022-2023学年浙江省杭州市萧山区人教版三年级上册期中考试数学试卷1学校:___________姓名:___________班级:___________考号:___________一、填空题.有个,的个数是的倍,有最大的三位数与最小的三位数相差);二、判断题11.1吨重的铁要比1000千克的棉花重一些。
()12.一根绳子对折两次后的长度是5厘米,这根绳子的总长是2分米。
()13.算式701198-的结果与算式7012002--的结果相同。
()14.一个人唱一首歌需要3分钟,5个人合唱这首歌需要15分钟。
()15.分针从一个数字走到下一个数字,经过的时间是1分。
()三、选择题16.港小春晚在学校报告厅举行,报告厅共有630个座位,如果二年级346名学生和三年级315名学生要同时观看港小春晚,坐得下吗?()A .坐得下B .坐不下C .可能坐得下D .可能坐不下17.一个数是8的3倍,那么这个数是6的()倍。
A .3B .4C .6D .818.用900个鸡蛋孵小鸡,上午孵出了337只小鸡,下午比上午多孵出118只,一共孵出多少只小鸡?列式正确的是:()。
A .337118+B .()900337118-+C .337337118++D .()900337337118-++19.下面物品中()的重量最接近1千克。
A .100粒黄豆B .3听易拉罐可乐C .5个鸡蛋D .1袋大米20.根据图中的竖式,可以知道:()。
A .☆=△B .☆-△=1C .☆<△D .☆+△=9四、口算和估算21.直接写出得数。
174+16=100-34=89+26=190-130=83-58=34+28=66-42=31+59=22.直接写出得数。
123-47=188+112=413-14=524+476=36+25-14=54÷9×6=8×8-54=35÷5×3=五、填空题23.在()里填上合适的数。
Lecture Three Morphology (II)In last lecture, we have discussed mechanisms by which new words can enter a language (left column) and by which the meaning of existing words can change.New words Meaning changeCoining Change in part of speechAcronym formation Metaphorical extensionAlphabetic abbreviation BroadeningClipping NarrowingBlending Semantic driftGenerification ReversalAppropriation of proper nounsBorrowing: directBorrowing: indirect (calques)Derivational morphologyIn this section, we are going to discuss Derivational Morphology (Word Formation Rules)New vocabulary can also be added by following rules that incorporate specific derivational processes. For the most part, the core of each process is an already existing word, to which other words and affixes can be added.The compositionality (the property whereby the meaning of whole expression is determined is determined by the meaning of its parts) only partially holds in derivational morphology. Compounds and compoundingIn English and other languages new words can be formed from already existing words by process known as compounding, in which individual words are joined together to form a comound word, as illustrated in table 2.2Noun +Noun : landlord/ chain-smoker/ snail mailAdj+ Noun: high chair/ blackboard/ wildfirePrep.+ Noun: overdose/ underdog/ underarmVerb+ Noun: go-cart/ swearword/ scarecrowAdj.+Adj. : red-hot/ icy-cold/ bittersweetNoun+ Adj.: sky-blue/ earthbound/ skin-deepPrep.+ Verb: oversee/ overstuff / underfeedGenerally speaking, the part of speech of the whole compound is the same as the part of speech of the rightmost member of the compound, which is termed the head of the compound.b. Compounds are not limited to two words …Eg. sailboat rigging design training institutec. Certain compounds have a characteristic stress pattern. In compound nouns consisting of two words the main stress comes on the leftmost member of the compound.Eg. moviestar / bathroom / highchair/ greenhouse/ blackbirdCompounds are rarely completely compositionalEg. alligator shoes vs horse shoessalt pile vs salt shakerCompounding is a rich source of new words in English, and many compounds are numbered among recent additions to the languageHeadless compounds: pickpocket/ cutpurseThe Agentive Suffix –erthe process of agentive noun formation establishes a relationship between verbs and nouns. The –able SuffixThere is an obvious systematic relation between the words in the two volumns. … That is, the relation between read and readable is not arbitrary; rather, the suffix –able is a morpheme that is used in a highly systematic way.What are the various effects of the –able suffix? In what basic ways are the verbs changed when –able is added?a.Phonological changerelate relationdictate dictationinvestigate investigation/t/ /ʃ/ (V+ -ation)b.Category changec.Semantic changeIn general, then, whenever we postulate a systematic morphological relation between sets of words, we will describe the above three changes if any, that characterize the relationship. The Diminutive Suffix –y/-ieNot all affixes cause the sorts of changes we have observed with the –able suffix. BackformationA particularly interesting case illustrating the “psychological reality” of morphological rules is a phenomenon known as backformation, in which word formation processes are “reversed”.In short, backformation is the process of using a word formation rule to analyze a morphologically simple word as if it were a complex word in order to arrive at a new, simpler form.Eg. laseremote emotiondonate donationFinally, a slightly different sort of backformation has applied to the word cranberry.In sum, these cases show that morphological rules and analyses are not simply abstract aspects of morphological theory.2.4 Inflectional versus derivational morphologyInflectional affixes never change the category.Inflectional and derivational suffixes occur in a certain relative order within words: namely, inflectional suffixes follow derivational suffixes.Inflectional and derivational affixes can be distinguished in terms of semantic relations. To sum up, then, inflectional affixes indicate certain grammatical functions of words; they occur in a certain order relative to derivational affixes; and they are not associated with certain changesthat are associated with derivational affixes. Inflectional affixes are often discussed in terms of word sets called paradigms.BakeBakesBaking2.5 Problematic aspect of morphological analysisNow we must face one of the hard facts of life in doing morphological an analysis, namely, the exceptions or apparent exceptions to many aspects of a given analysis.Productivity根据下面的语料,写出形态规则:peaceable / companionable / marriageable / impressionable / knowledgeable / actionable / saleable / reasonable/ fashionableFalse analysisBound base morphemes… the case of a complex word with a recognizable suffix or prefix, attached to a base that is not an existing word of the language.。
CARTAGO Annotated ManualCARTAGO v.0.6.0Reference author:aricciDocument revision:001Creation date:2006-10-06Last Changes date:2007-05-12aliCE teamDEIS,Universit`a di Bologna,ItalySede di Cesena(FC)Contents1Introduction31.1What is CARTAGO (3)1.2Human Cooperative Working Environments as BackgroundMetaphor (4)1.3The A&A model:Agents,Artifacts and Workspaces (4)1.4Using CARTAGO inside agent-oriented frameworks (5)2CARTAGO Basic Concepts62.1Introduction (6)2.2The Artifact abstraction (6)2.3Agent bodies (7)2.4Workspaces (8)2.5CARTAGO Application Programming Interface (8)3Programming Artifacts103.1The Basic Programming Model (10)3.2Artifact template definition (11)3.2.1Usage interface and related operations (12)3.2.2Operations composed by steps (13)3.2.3Temporal guards (16)3.3Examples (17)3.4Artifact manual (18)3.5Observable states and properties (18)3.5.1Observable properties (19)3.6Linkability and linkable interfaces (19)4Agent API for playing inside a CARTAGO environment214.1Joining an environment (21)4.2Artifact use (22)14.2.1Executing operations (22)4.2.2Sensors and sensing (22)4.2.3Focusing an artifact (23)4.3Artifact instantiation (24)4.4Artifact lookup and discovery (24)4.5Using artifacts:an example (24)4.6Inspecting and manipulating artifacts (25)4.7Linking artifacts (25)4.8Other features (25)4.8.1Custom Filter-driven perceptions (25)4.8.2Sensing on multiple sensors (26)5Advanced issues275.1Working sessions with artifacts (27)6Available libraries286.1GUI Artifacts (28)6.2Coordination artifacts (28)6.2.1Basic coordination bricks (28)6.2.2Tuple spaces (28)6.2.3Tuple centres (28)6.3WS related artifacts (29)2Chapter1Introduction1.1What is CARTAGOCARTAGO(Common ARTifact for AGents Open environment)is a general-purpose infrastructure to design and create working environments for agent-oriented applications engineered upon the principles of the A&A(A gents and A rtifact)meta-model[3,2,1].In order to tackle the complexity of the engineering of modern software systems,the A&A meta-model introduces high-level metaphors which drawn their inspiration from human society,in particular human cooperative work-ing environments:agents—analogous to humans,as executors of activities and activities—and artifacts—analogous of the objects,resources,tools that are dynamically constructed,used,manipulated by humans to support /realise their individual and social activities.Actually,A&A based on inter-disciplinary studies involving Activity Theory and Distributed Cognition as main conceptual background frameworks.CARTAGO is a framework that makes it possible to agents and agent programmers to define and build their own computational working environ-ments composed by dynamic sets of artifacts of different kinds.It is not bound to any specific agent model or platform:it is meant to be orthogonal with respect to the specific agent model or platform adopted to define agent architecture and behaviour.31.2Human Cooperative Working Environmentsas Background MetaphorEvery paradigm,computational model,or language is based on some kind of driving abstract or high level metaphors,which are often are essential to de-fine the main characteristics of the paradigm abstractions.A&A metaphors are taken from humans cooperative working environments,where“systems”are composed by individual autonomous entities(humans),encapsulating different kind of skills,which actively carry on some kind of activities or activitys,both individual and cooperative,which needs coordination with other individuals.A fundamental aspect of such a picture is the context —or the environment—that makes it possibile to such activities to take place.artifacts designed and built by humans are an essential part of such a context,both as outcome of the activities and as tools exploited by humans to support and realise them.Artifacts can be then resources and objects constructed during the activities,but also whatever tools is used to make humans communication,coordination,and work easier.So,the overall pic-ture is given by workspaces where ensemble of individuals work and interact in a coordinated manner,by communicating and sharing/using the same artifacts,so as to achieve some kind of objective.A&A brings this metaphor down to software engineering,conceiving a software systems as one or multiple workspaces where ensemble of au-tonomous entities called agents execute their working activities and interact by co-constructing,sharing and using artifacts,analogously to the human case.1.3The A&A model:Agents,Artifacts andWorkspacesWhile classes and objects are still used to represent basic data structures and abstract data types,in A&A agents and artifacts are used as basic high-level building blocks to decompose and structure complex systems,composed by ensemble of interacting and coordinating parts.In particular:•agents can be used to model asfirst-class abstraction pro-active en-tities,i.e.entites programmed so as to autonomously execute some kind activity–composed by one or more activitys–encapsulating the control of such activity;•artifacts can be used to model asfirst-class abstraction what is used4or constructed by agents during their activities,including resources, tools,devices,typically passive entities encapsulating some kind of functionality;•workspaces are the logical place where agents and artifacts are im-mersed,used to give a topology to the overall activities,and then partition the application environment.Objects and classes are used as basic abstractions to define data structures to build agents and artifacts.1.4Using CARTAGO inside agent-oriented frame-worksCARTAGO is meant to be integrated with frameworks/platforms which make it possible to define and create agents.TO BE COMPLETED Integration with an existing framwork.Hereflat use of CARTAGO5Chapter2CARTAGO Basic Concepts2.1IntroductionAn agent can participate and interact inside CARTAGO environments by creating and piloting a body inside them.The agent body represents the mean by which an agent can execute actions inside an environment where the body is situated—for instance executing operations on artifacts—and can perceive environment events.Conceptually the body contains the effectors and sensors that make it possible actions and perceptions.An agent body created inside a CARTAGO environment can be then suitable controlled and piloted by some kind of agent program,encapsulating the logic of the agent activities.The agent program conceptually plays the role of the agent mind,animating the body according to some kind of objective.2.2The Artifact abstractionArtifacts are passive state-ful entities designed so as to be used by agents–either individually or collectively–in their working activities.Artifacts are designed to encapsulate some kind of function,as a set of functionalities or services.Artifact function is structured in terms of a set of operations,that agents can trigger and control through artifact usage interface.Such usage interface is composed by a set of interface controls,identified by a name and a set of parameters specified as arguments:such controls can be used to trigger the execution of operations,and possibly to control dynamically such execution.Operation execution can result in the generation of observable events,6Figure 2.1:(Left)Abstract representation of an artifact.(Right)Abstract representation of a working environment with two workspaces,with some artifacts of different kinds inside.which can be observed and processed by agents as perceptions.Observable events can be generated through the use of specific primitives (genEvent ),available for programming artifact behaviour when defining operation bod-ies.The set of operations exposed by the usage interface actually depends on artifact observable state ,which can change dynamically.Artifact func-tionalities (and behaviour)can be structured by the artifact programmer in a set of (observable)states,with a different set of operations according to the specific states.Practically,the artifact interface is not fixed,but changes dynamically according to how the artifact is programmed and how is used by agents.The description of the usage interface account for the description of the set of operations grouped in states.It is not a partition:the same operation can be defined in multiple states.The observable state of an artifact can be inspected and changed by suitable primitives available for defining artifact behaviour.2.3Agent bodiesAgents can interact within their surrounding computational envirornment by means of actions —to effect and influence it,as a form of output —and perceptions ,as a form of input.This basic interaction model –which provides a high level of uncoupling between agents and their environment –is suitable in particular taking in consideration one of the basic feature characterising agent abstraction,which is the encapsulation of control.Generally speaking,agents’computational environment is composed by (ii)artifacts and (i)other agents.Basic actions are then provided to sup-7port both agent interaction with artifacts(construction,use,inspection, manipulation)and agent communication with other agents(through com-munication acts).Among the actions available for interacting with artifacts, for instance,basic actions are provided to create artifacts and to execute op-erations on them.Inputs are in terms of perceptions that agents can perceive through sen-sors.An agent can have(attach dynamically)one or more sensors,of differ-ent kind,possibly with different kind of properties(e.g.filtering,buffering).A sensor functions as a collector of stimuli directed to the agent or in some way of interest of the agent.Stimuli can be observable events generated by artifacts immersed in the same environment or message sent by other agents.In order to be aware of the stimuli received,in other words in order to transform stimuli in perceptions—referred here as sensing—,an agent is provided by a family of sense actions:by executing a sense action,possibly specifying a specific sensor,collected stimuli are fetched and processed as perceptions.CARTAGO supports data-driven sensing,i.e.sensing driven byfilters or patterns,which make is possible to select stimuli(perceptions) according to their content.2.4WorkspacesAgents and artifacts are created and lives in a labelled working environ-ment,which acts as logical container of the entities,actually enabling their existence and interaction.In other words,a working environment can be thought as the overall context of a multi-agent system,composed by agents and artifacts.Each environment can be thought as specific and indepen-dent configurable world,providing basic services to spawn agents,create/ dispose artifacts and inspection facilities.In the A&A model,environments can be organised in workspaces,acting as basic abstraction to define environment topology[2]:such a feature is not part of current version of CARTAGO,and will be introduced in future release.In the simplest case,a CARTAGO application then is defined by a single environment,setup with some starting agents and artifacts.2.5CARTAGO Application Programming Interface In the overall,CARTAGO provides a direct support for:•designing and programming the artifacts8•the API to be exploited in agent programs to create,use,manipulate artifacts in workspaces9Chapter3Programming Artifacts3.1The Basic Programming ModelConcrete artifacts are instances of artifact templates,which define the basic characteristics of all the artifacts instances of such templates(like classes for objects in OO).An artifact(template)is defined by:•a set of state variables,that is the data structures defining the overall persistent state of the artifact;•a set of operations implementing the artifact function.Any operation is characterised by one or multiple interface controls,that are what agents can act upon so as to trigger and control the execution of the operation.Then,besides the control(s),the operation business logic is implemented in one or multiple operation steps,which represent computa-tional chunks defining—in the overall—the behaviour of the operation.The execution of an operation is given by the sequential execution of one or mul-tiple operation steps.As a fundamental aspect of the model—in particular for concurrent systems—,only one step at a time can be in execution in an artifact,so their execution can be conceived as atomic with respect to the other steps in execution in the same artifacts.Multiple operations can be in execution concurrently in the same artifact however,thanks to the interleaving of the steps.Each operation and operation step isfirst triggered for being executed, and then executed as soon as the operation(step)guard is satisfied.A guard specifies the pre-conditions that must be specified for the operation(step) to be executed.If the guard of a triggered step is false,then the step is not executed and the operation on the overall keeps in a pending state.As10XFigure3.1:Abstract representation of operations and operation steps soon as the guard condition is verified–due to changes in the artifact state –then the step is executed.A guard can be of two basic types:either a general boolean function over the state of the artifacts or a timed trigger, that is a guard which is evaluated to true when some kinds of temporal event occur—i.e.a specific amount of time has elapsed.If more steps at a time can be executed,the mutual exclusion is preserved by(evaluating the guard and)executing the step one by one..By default,an operation is composed by a single step,with the guard sets to true.Operation steps are the way in which it is possible to structure complex and interacting operations,on the one side preserving mutual exclusion in updating artifact state(because only one step at a time can be in execution), on the other side enabling the possibility to execute multiple operations concurrently,by interleaving their steps.3.2Artifact template definitionAn artifact type is defined by a single class extending the alice.cartago.Artifact base abstract class,adopting some strict con-vention in the definition of its parts which make it possible to map the basic features of the artifact abstraction.An artifact is a state-ful passive entity encapsulating a set of operations which can be executed by agents in order to exploit artifact function.Quite intuitively,state variables of an artifact is defined in terms of instancefields11of the class,while operations can be specified through sets of methods ad-hering to some basic rules.3.2.1Usage interface and related operationsIn particular,in order to define an operation op triggered by an interface con-trol op(param1,param2,...)—where param1,param2,...represent the parame-ters of the control—a method op must be defined,annotated with@OPERATION annotation.Such a method represents thefirst operation step executed when the operation op is triggered by the agent.Operation controls can have a list of input parameters–which correspond to method parameters–and no return parameter(so every operation method must return void).The following example shows the definition of a simple artifact Count functioning as simple counter,with a usage interface with an operation for incrementing the count:public class Count extends Artifact{int count;public Count(){count=0;}@OPERATION void inc(){count++;}}To be useful,an artifact typically should provide some level of observability. Accordingly,observable events can be explicitly generated in the body of operations.For this purpose the genEvent primitive is provided:genEvent(String evType,Object evContent)The primitive generates an observable event that can be observed by the agent responsible of the execution of the operation,and by all the agents observing the artifact.An observable event is represented by a string describing the kind of the event and possibly an object representing the content.The following example extends the previous Count artifact,with the gen-eration of an event new count value each time the count is updated:public class Count extends Artifact{12int count;public Count(){count=0;}@OPERATION void inc(){count++;genEvent("new_value",count);}}It’s worth remarking that every operation control methods has no return value,even getValue:differently from methods in OO,in the A&A model informationflow from artifacts to agents is modelled as observable events generated by artifacts and perceived by agents.Default eventsSome observable events are generated by default with operation execution. In particular:op execution triggeredop execution startedop execution completedop execution failedop execution abortedThe events are generated respectively when an operation is triggered, when its execution after being triggered started,when the operation execution completed,failed and aborted.3.2.2Operations composed by stepsIn the example all the operations are composed by an single step,whose name coincide with the operation name.Actually,an operation can be composed by multiple steps,which are described by means of the@OPSTEP annotation and triggered(enabled)by executing the nextStep primitive, specifying the name of the step to be enabled.The declaration of an opera-tion step is analogous to the declaration of an operation control,as a method with some parameters and no return parameter.Guards are implemented as boolean methods annotated with the@GUARD annotation.13So,the exact syntax for nextStep is:nextStep(String opStepName)The effect of the primitive is triggering the execution of the step with the specified name.The step is actually executed as soon as its guard is evaluated to true.Here it is a simple example:public class MyArtifact extends Artifact{int m;@OPERATION void op1(){m=1;nextStep("opStepA");}@OPERATION void op2(){m++;}@OPSTEP(guard="canExecOpStepA")void opStepA(){log("op1completed.");}@GUARD boolean canExecOpStepA(){return m==5;}}In the example,the operation op1is composed by two steps,afirst one which is the operation control used to trigger the operation and a second one,opStepA,triggered by thefirst by means of the nextStep primitive.Once triggered,the step is executed as soon as canExecOpStepA guard is evaluated to true.In the specific example,the step opStepA can be executed only when the internal variable m of the artifact reaches a value equals to5.This is possible only by executing the operation op2.So by executing the operation op1,the operation is not completed until the operation op2is invoked four time: then,the second(andfinal in this case)step of the operation is executed and the operation op1completed.For both—the operation step and the related guard—the parameters14declared must coincide with the parameters declarared by the operation-or the operation step-that triggered the operation step/guard.Actually,a guard can be specified not only for operation steps,but also for operation controls.In order to specify a guard for an operation,the guard property can be specified inside the@OPERATION annotation:public class MyArtifact extends Artifact{int m;@OPERATION(guard="canExecOp1")void op1(){m++;}@GUARD boolean canExecOp1(){return m<10;}}In this example,once triggered,the operation op1is executed only if(when) the value of the variable m is less than10.Sequence of stepsMultiple steps can be triggered as next steps of an operation at a time.For instance:public class MyArtifact extends Artifact{private int m;@OPERATION void op1(){nextStep("op2");nextStep("op3");}@OPSTEP(guard="xxx")void op2(){..}@OPSTEP(guard="yyy")void op3(){..}}As soon as the guard of one is evaluated to true,the step is executed—in mutual exclusion with respect to the steps of the other possible operations in execution—and the other triggered steps of the operation are discarded.In other words an operation execution accounts for a sequence of step execution, with no trees.If multiple steps are evaluated to be runnable at a time,one15is chosen according to the order in which they have been triggered with the nextStep primitive.3.2.3Temporal guardsActually,also temporal guards are supported,i.e.guards whose evaluation is true after that a specific delta time is elapsed by the time they have been triggered.To define a temporal guard,a tguard property must be specified inside the@OPSTEP annotation in the place of guard:the property can be assigned with a long value greater that0,indicating the number of milliseconds that must elapse before the step could be executed,after having being triggered.As a simple example,the following is a clock artifact exploiting temporal guards:public class Clock extends Artifact{int nticks;boolean stopped;public Clock(){nticks=0;stopped=false;}@OPERATION void start(){stopped=false;nextStep("tick");}@OPERATION void stop(){stopped=true;log("STOPPED.");}@OPSTEP(tguard=1000)void tick(){if(!stopped){nticks++;log("TICK"+nticks);nextStep("tick");}}}16The artifact generates a tick event every second,after it has been started by means of the start)interface command.The counting can be stopped then by means on the stop command.3.3ExamplesThe following example shows a simple Buffer artifact,in which thefirst primitive is used:import alice.cartago.*;import java.util.*;public class BufferArtifact extends Artifact{private LinkedList<Object>items;public BufferArtifact(){items=new LinkedList<Object>();}@OPERATION void put(Object obj){items.add(obj);}@OPERATION(guard="itemAvailable")void get(){Object item=items.removeFirst();genEvent("new_item_available",item);}@GUARD boolean itemAvailable(){return items.size()>0;}}The usage interface includes a put operation to insert items in the buffer and a get operation to consume items from the buffer.The artifact functions as follow:the get operation generates an ItemAvailable event as soon as an item is available in the items used to keeping tracks of item objects.The put operation just inserts the item in the items:if there were pending get operations,then their guards are evaluated(which are implemented by the itemAvailable method)and the operation possibly executed.173.4Artifact manualEach artifact is meant to be equipped with a manual,i.e.a document for-mally describing all the aspects that a user(agent)can read and understand so as to use the artifact.Such information include the intended purpose of the artifact(function description)and how to use the artifacts(operating instructions).The description must be based on some kind of ontology, giving a precise semantics to the manual.TO BE COMPLETED Operating instructions and function description, defined in@ARTIFACT MANUAL.3.5Observable states and propertiesBesides observable events,observable states can be defined as a way to struc-ture artifact functionalities,in particular for complex artifacts,to simplify their usage.In particular,for each type of artifact,designers and program-mers can define a basic set of states–represented by label–and the shape of the usage interface depending on the specific state.The idea is that the usage interface of an artifact can change according to the observable state of the artifact.Artifact observable states can be defined through@ARTIFACT MANUAL an-notation for the classes defining new kind of artifacts,in particular specifying a statesfield.Then,it is possible to include in the@OPERATION annotation the list of states in which the operation is defined(as a list of strings,repre-senting state name).By default,each artifact has an observable state called default,and all the operations belongs to such a state.In the following example,MyArtifact is defined with three states,namely stateA,stateB and default which is always present.In default state the us-age interface is composed only by op1operation,in stateA state the usage interface is composed by op2and op3operation,andfinally in stateB state the usage interface is composed by only op3operation.@ARTIFACT_MANUAL(states={"stateA","stateB"})public class MyArtifact extends Artifact{public MyArtifact(){}@OPERATION void op1(){switchToState("stateA");}18@OPERATION(states={"stateA"})void op2(){switchToState("stateB");}@OPERATION(states={"stateA","stateB"})void op3(){if(getCurrentObservableState().equals("stateB")){switchToState("default");}}}Two basic primitives then are provided to manage artifact state:switchToState(String stateName)getCurrentObservableState():StringThe former makes it possible to change dynamically the observable state of the artifact(and the also the operations available in the usage interface),and the latter to inspect current state.In the example above, the execution of op1operation causes an observable state transition from default to stateA,the execution of op2from stateA to stateB,and op3from stateB back to default.3.5.1Observable propertiesTO BE DEFINED Defining the properties that are observable to the agent 3.6Linkability and linkable interfacesArtifacts can be composed together by linking them through their link in-terface.Generally speaking,a link interface defines a set of operations that can be triggered by an artifact on another artifact.The notion is analo-gous to the usage interface,with the difference that the entity triggering the operation execution is not an agent,but another artifact.Once triggered,linked operation execution is the same as normal opera-tions,triggered by the usage interface(so they can be composed by multiple steps,can generate events,etc.)The only difference is that the events that are generated by a linked operations,are made observable to the agent using or observing the artifact the triggered the execution of the link operation.In the case of a chain,with an agent X executing an operation on an artifact,19which links the operation of an artifact B,which links an operation of an artifact C,all the observable events generated by B and C linked operations are made observable to X.Linking is unidirectional:by linking an artifact A to an artifact B,A can invoke the operations belonging to the link interface provided by B.By creating a bidirectional link,also A must expose a link interface and artifact B must be linked to A.20Chapter4Agent API for playing insidea CARTAGO environment4.1Joining an environmentIn order to play inside an environment,an agent must join it by exploiting the join service provided by the class Cartago,specifying a user name(that corresponds to the agent name).By joining an environment,an agent body is created inside the environment and the agent receives a suitable interface to play(ICartagoContext),through the body.The following snap of code shows an example about joining a working environment called test-env, with a user name pippo:..ICartagoEnvironment env=Cartago.getInstance("test-env"); ICartagoContext context=env.join("pippo");..By exploiting the context reference it is possible to play inside the test-env working environment.The basic actions available to an agent can be cate-gorized in:•artifact construction and use•artifact inspection and manipulation•sensing(observation)21。
Math7h Professor:Padraic Bartlett Lecture1:Period Three Implies ChaosWeek1UCSB2014 (Source materials:“Period three implies chaos,”by Li and Yorke,and“From Interme-diate Value Theorem To Chaos,”by Huang.)This lecture,roughly speaking,is about how the intermediate value theorem is a deeply strange and powerful piece of mathematics.On itsfirst glance,it looks pretty innocuous.Here’s the theorem statement,as you’ve probably seen it in calculus:Theorem.(Intermediate Value Theorem.)Suppose that f is a continuous function on some interval[a,b],and L is a value between f(a)and f(b).Then there is some value x∈[a,b]such that f(x)=L.On its face,this looks pretty normal,and quite believable:if a continuous function starts at f(a)and ends up at f(b),then it must adopt every value between f(a)and f(b) along the way.Despite its simplicity,the intermediate value theorem has a lot of useful, obvious,and not-entirely-obvious applications:1.Suppose that you are running a race and are in last place.If youfinish infirst place,then at some point in time you must have passed the other runners.To make this an intermediate value theorem problem:for each other runner i,let f i(t)denote the signed distance between you and that runner.At the point in time in which you are in last,the function f i(t)is negative;at the point in time when youfinished the race,f i(t)is positive.Because f is continuous1,then there must be some time t wheref i(t)=0,at which point you pass that runner.2.Suppose that p(x)is a polynomial of odd degree:i.e.that there are coefficientsa0,...a n such that p(x)=a0+...+a n x n,with n odd and a n=0.Then p(x)has a root:i.e.there is some value x0such that p(x0)=0.This is because for sufficiently large values of x,p(x)will be dominated by its a n x n term,and thus become whichever sign a n is.Therefore,for sufficiently large values of x,p(x)and p(−x)are different signs!So we can apply the intermediate value theorem and choose L to be0,which gives us that there is some value at which f(x0)=0.3.Suppose that f(x)is a continuous function on[a,b],whose range contains the interval[a,b].Then there is some point x0∈[a,b]such that f(x0)=x0:i.e.there is a point in our interval that our function does not change.This is not hard to see.Because[a,b]is within the range of f(x),there are two values c,d∈[0,1]such that f(c)=0,f(d)=1.If c=a or d=b,we’ve found our point!Otherwise:look at the function g(x)=f(x)−x.At c,we have g(c)=a−c<0, because c is a number in[a,b]not equal to a.At d,we have g(d)=b−d>0,because 1Assuming that you’re not cheating or(less likely)quantum-tunneling during said race.1d is a positive number not equal to b in[a,b].Therefore,by the intermediate valuetheorem,there is some point x0between c and d such that g(x0)=0.But this means that f(x0)−x0=0;i.e.f(x0)=x0,and we have our result!This third example is the one I want to study today,because it allows us to motivate the primary concept we are studying today:the notion of period.1Periodic PointsDefinition.Let f(x)be some function.We say that a point x0in the domain of f is a periodic point with period n if the following two conditions hold:1.f n(x0),the result of applying the function f n times in a row to x0(i.e.n timesf(f(...f(x0)...)),is equal to x0.2.For any k,1≤k≤n−1,f k(x0)=x0.In other words,a point has period n if applying f to that point n times returns that point to itself,and n is the smallest value for which this point returns to itself.In the third example,we looked at points with period1.We call such pointsfixed points,because they arefixed under the mapping f,and(as we’ve shown above)it’s not too hard tofind examples of such objects!Finding examples of other such points is a bit trickier,but not too hard.Consider the polynomialp(x)=3x2−72x+1.Notice that•p(0)=1,•p(1)=1/2,and•p(1/2)=0;therefore,0is a point of period3.Determining whether this function has points with other periods,though:like points with period5,or7,or6...seems hard.How can we do this?Well:the intermediate value theorem gave us a way tofindfixed points.Perhaps we can build something out of the intermediate value theorem that canfind periodic points!As it turns out,we can do this via the following theorem:Theorem.Let f(x)be a continuous function on the interval[a,b],and I0,...I n−1denotea collection of closed intervals that are each contained within[a,b].Assume that1.f(I k)⊇I k+1,for every k=0...n−2,and22.f(I n−1)⊇I0,where by f(I k)we mean the set given by applying f to all of the points in the interval I k. (In other words,applying f to any one interval I k gives you a set that contains the next interval I k+1)Then there is some point x0∈I0such that1.f n(x0)=x0,and2.f k(x0)∈I k,for every k=0,...n−1.Note that if we can make all of the I k’s for k≥1not contain points in I0,then any solution of the above is a point with period n,because each f k(x0)will be contained in I k,and therefore not a point in I0(and in particular not equal to x0itself!)We prove this theorem here:Proof.We start by observing the following useful fact:Lemma1.If f(I k)⊇I k+1,then there is a subinterval of I k such that f(I k)=I k+1. Proof.This is a consequence of the intermediate value theorem.Suppose that I k+1=[c,d], for some pair of endpoints c,d.Because f(I k)⊇[c,d],there are values that get mapped to c and d themselves.Pick x1,x2such that f(x1)=c,f(x2)=d,and x1,x2are the closest two such points with this property.Claim:this means that f([x1,x2])=[c,d].To see why,simply use the intermediate value theorem to see that f([x1,x2])contains[c,d].Moreover,if it contained a point z/∈[c,d], then(if x3maps to z)the intermediate value theorem would tell us that we canfind a point that maps to one of c,d in one of the intervals[x1,x3],[x3,x2],in such a way that violates our“closest two points”property!So we’ve proven our lemma.such that Given this lemma,our proof is relatively simple.Find intervals I∗k•I∗0⊆I0and f(I∗0)=I1,•...•I∗n−2⊆I n−2and f(I∗n−2)=I n−1,and•I∗n−1⊆I n−1and f(I∗n−1)=I0.Then,as a consequence,we must have thatf k(I∗0)=I∗k,for any k,andf n(I∗0)⊆I∗0.Tofinish our proof,then,we just have to notice that because f is continuous,so is f n! Therefore,because f n(I∗0)⊆I∗0,we know from our result at the start of the lecture onfixed points that there is some x0∈I∗0such that f n(x0)=x0!Therefore we’ve proven our claim: we have found a point x0such that31.f n(x0)=x0,and2.f k(x0)∈I k,for every k=0,...n−1.2Why We Care:ChaosSo:the reason we care about all of this isn’t really because we want tofind periodic points; rather,it’s because we want to know when we can avoid them!Consider the following problem:Problem.Suppose we have afluidfilled with particles in some reasonably-close-to-one-dimensional object,which we can model as an interval[a,b].Furthermore,suppose that we know how thisfluid is“mixing:”i.e.that we have some function f:[a,b]→[a,b],such that f(x)tells you where a particle at location x will wind up after one step forward in time.Where do your particles go?Do they settle down?Do they all clump together at one end?In other words:what does f n look like as n grows very large?Something you might hope for is that yourfluid particles settle down:that they either converge to various states,or at least that they all settle into some small set of predictable periodic orbits.In the worst case scenario,however,you might have something like the following:Definition.A function f is called chaotic if for any n,it has a particle of period n.So!The punchline for this class is the following theorem of Li and Yorke:Theorem.Suppose that f is a continuous function on[a,b]with range contained in[a,b]. Then if f has a3-periodic point,it is chaotic.Proof.Take a triple x0<x1<x2of points that form a3-periodic orbit.Either f(x1)=x2 or f(x1)=x0;assume that f(x1)=x0without loss of generality,as the proof will proceed identically in the other case.Then we have f(f(x1))=f(x0)=x2.Let I 0=[x0,x1]and I 1=[x1,x2].Note that because f(x0)=x2,f(x1)=x0,f(x2)= x1,by the intermediate value theorem,we have•f(I 0)⊇[x0,x2]⊃I 1,I 0,and•f(I 1)⊇[x0,x1]⊃I 0.So:let I0=...I n−2=I 0,and I n−1=I 1.Apply our theorem from before that was designed tofind periodic points:this gives us a point x0such that x0,f(x0),...f n−2(x0)∈I 0,f n−1(x0)∈I 1,and f n(x0)=x0.I claim that this point is a n-periodic point.We already have that f n(x0)=x0;we just need to prove that f k(x0)=x0,for any k=1,...n−1.To see this,proceed by contradiction.Suppose that f k(x0)=x0,for some k.Then f n−1(x0)is equal to an earlier term f n−1−k(x0),because applying f k times is the same thing as doing nothing.But this means that4•on one hand,f n−1(x0)∈I 1,and•on the other hand,f n−1(x0)=f n−1−k(x0)∈I n−1−k=I 0.Therefore this point is in both sets.But the only point in both I 0=[x0,x1]and I 1=[x1,x2] is x1;so f n−1(x0)=x1.But then f n(x0)=x2,which is not in I 0and therefore in particular is not x0!So we have a contradiction to our assumption that x0was not a point with period n.This is...weird.All we used in the above statement was that there was a point with period3–i.e.some point such that f(f(f(x)))=x,while f(x),f(f(x)=x.And out of nowhere we got points of every period:chaos!Cool,right?5。