A Framework for Knowledge Management and Automated Reasoning Applied on Intelligent Transport Systems AnetaVulgarakisFeljan1,AthanasiosKarapantelakis1,LeonidMokrushin1,HongxinLiang1,Rafia Inam1,ElenaFersman1,CarlosR.B.Azevedo2,KlausRaizer2 andRicardoS.Souza2 1EricssonResearch,Sweden 2EricssonResearch-ARBB,Brazil Email:fi[email protected] Keywords: Knowledgemodel,Reasoning,Ontology,Modeltransformation,IntelligentTransportSystems 7 1 Abstract: Cyber-PhysicalSystemsingeneral,andIntelligentTransportSystems(ITS)inparticularuseheterogeneous 0 datasourcescombinedwithproblemsolvingexpertiseinordertomakecriticaldecisionsthatmayleadtosome 2 formofactionse.g.,drivernotifications,changeoftrafficlightsignalsandbrakingtopreventanaccident.Cur- n rently,amajorpartofthedecisionprocessisdonebyhumandomainexperts,whichistime-consuming,tedious a anderror-prone.Additionally,duetotheintrinsicnatureofknowledgepossessionthisdecisionprocesscannot J beeasilyreplicatedorreused.Therefore,thereisaneedforautomatingthereasoningprocessesbyproviding 1 computationalsystemsaformalrepresentationofthedomainknowledgeandasetofmethodstoprocessthat 1 knowledge.Inthispaper,weproposeaknowledgemodelthatcanbeusedtoexpressbothdeclarativeknowl- edgeaboutthesystems’components,theirrelationsandtheircurrentstate,aswellasproceduralknowledge ] I representingpossiblesystembehavior.Inaddition,weintroduceaframeworkforknowledgemanagementand A automatedreasoning(KMARF).TheideabehindKMARFistoautomaticallyselectanappropriateproblem . solver based on formalized reasoning expertise in the knowledge base, and convert a problem definition to s c thecorrespondingformat. Thisapproachautomatesreasoning,thusreducingoperationalcosts,andenables [ reusabilityofknowledgeandmethodsacrossdifferentdomains.Weillustratetheapproachonatransportation planningusecase. 1 v 0 0 1 INTRODUCTION perts. Moreover, in order to be able to provide sup- 0 3 portforinformationinteroperabilitybetweenapplica- 0 tions, ITS-related information needs to be semanti- IntelligentTransportSystems(ITS)presentasubclass . cally enriched in other words identified, categorized 1 of Cyber-Physical Systems (CPS) due to the inter- 0 action between physical systems (vehicles) and dis- anddescribedexplicitly.Eventhoughstandardization 7 tributed information acquisition and propagation in- activities have facilitated certain network-level inter- 1 operability (IEEE Standards Association, 2010) and frastructure (wired/wireless networks, sensors, actu- : Quality of Service (QoS), there are still inconsisten- v ators, processors and software). They are designed i toofferinnovativeservicestotransportationnetwork ciesbetweenITSgroupsonhowdataaremodeledon X a semantic level, as each organization (e.g., govern- users and managers alike, and cover a broad area of r mentregulator,commercialprovider,academicinsti- a advancedapplications,rangingfromimprovingman- tution)hascreateddomain-specificinformationmod- agement and safety of the transportation network, to elsforitsrespectiveITSapplications. infotainmentservices(Karagiannisetal.,2011). ITS in general use a vast amount of heterogeneous data In order to build intelligent systems one needs to streamsandinformation(e.g.,behavioralmodels)that startbymodelingandformalizingtheknowledgethat need to be analyzed, combined and actioned upon, exists (such as domain concepts, behaviors and con- whichcreatesacomplexitythatgoesfarbeyondmere text) and is retrieved from human experts. Knowl- human management. Hence, automation is a must, edgerepresentationandreasoning(KR&R)isafield which in its turn requires formalization of knowl- in artificial intelligence that aims at building intelli- edgeextractedfromthedifferentsourcessuchassen- gentsystemsthatknowabouttheirworldandareable sor networks, documents, tools and from system ex- toautomaticallydrawconclusionsandactuponthem, ashumansdo(Baral,2003). Afundamentalassump- State State State 1 2 3 tion in KR&R is that knowledge is represented in a is_bus(b25) is_bus(b25) is_bus(b25) tangible form (usually via ontologies), suitable for is_bus_stop(bs1) is_bus_stop(bs1) is_bus_stop(bs1) is_passeger(p1) is_passeger(p1) is_passeger(p1) processingbydedicatedreasoningengines. However, at(p1, bs1) at(p1, bs1) at(b25, bs1) up to today, there is a lack of frameworks for gen- capacity(b25, 23) at(b25, bs1) at(p1, b25) waiting(p1, min(2)) capacity(b25, 23) capacity(b25, 22) eralintelligencethatwillsolveseveralclassesofrea- waiting(p1, min(5)) soning problems, such as planning, verification and Figure1:Specificationofthreeexamplestates. optimization. Inaddition,itisstillnotcleartothein- telligentsoftwarecommunityhowtoeffectivelycope withtheintegrationofbothdeclarativeandprocedu- • An architecture of a generic framework for ralknowledgeandsomeauthorsadvocateforkeeping knowledge management and automated reason- the behavior descriptions separated from the seman- ing(KMARF)(Section2.2),relyingontheintro- tic,staticdomainknowledge(Ghallabetal.,2014). ducedknowledgemodel. In this paper, we present a Knowledge Man- • A taxonomy of ITS domain concepts that can be agement and Automated Reasoning Framework usedwhenreasoningaboutITSspecificproblems (KMARF), which targets multiple reasoning prob- (Section3). lems. The purpose for conceiving KMARF is to (a) reducesystemdevelopmentanddeploymenttime,by • A prototype implementation of the KMARF ar- reusing as much knowledge as possible, such as do- chitecture (Section 4) and an evaluation of the main models, behaviors and reasoning mechanisms, benefits of KMARF in terms of reducing the ef- and(b)reduceoperationalcostsbyrequiringlesshu- fort required for formalizing the knowledge and man involvement in system operations. The strong performingthereasoningbasedonit(Section5). point of KMARF is that it relies on a knowledge modelthatcombinesbothdeclarativeandprocedural knowledge. Thiscombinationallowsustodoexten- 2 KMARF – FRAMEWORK FOR siveanalysisandprovideanswerstodifferentreason- KNOWLEDGE MANAGEMENT ing questions, such as “what is the optimal strategy AND AUTOMATED for reaching a desired system state?” or “which ac- tionshaveledthesystemtoagivenstate?”. Inorder REASONING touseproblemsolversspecializedinsolvingspecific classes of reasoning problems, KMARF can be ex- In this section, we introduce our Knowledge Man- tendedwithmodeltransformationrulesthattranslate agement and Automated Reasoning Framework from our knowledge model to the targeted problem (KMARF)byshowingitsarchitectureandtheknowl- solvermodel. edge model that it relies on. KMARF is targeting KMARF is specifically targeting CPS, but it can multiple reasoning problem classes (such as plan- beappliedinotherareasaswell. Inthispaper,wefo- ning,verificationandoptimization)thatcansharethe cusononeoftheCPSdomainswhereKMARFmay same underlying state representation. This enables be applied – the ITS domain. As an illustration ex- reusability of knowledge and methods across differ- ample, we consider a transportation planning prob- entdomains. lemi.e.,transportpassengersorgoodswithaminimal cost.Acostcanbee.g.,thetraveleddistance,thetime 2.1 TheKnowledgeModel neededfortransportationofeachofthepassengersor goods, or the number of buses or trucks required for Syntax We model declarative knowledge by de- transportation. Theanswertothetaskmaybeaplan scribing discrete states of a system. One such state i.e., asequenceofstepsforthesystemtoperformin may represent the current state, and the others may order to reach the goal state. In case the task cannot describeeitherprevioussystemstatesorhypothetical be performed the answer from KMARF could be a statesthatthesystemmayendupinthefuture.Inthis reason why the task cannot be performed, as well as context we do not strictly apply the notion of time, the possible solution, which could be to increase the i.e., the system may change its state instantly. How- numberofvehicles. ever, the order of states is important as it describes Inbrief,ourcontributionisfourfold: howthesystemevolvesandmayexplainthereasons • A model for representing both declarative and behinditsprogress. proceduralknowledgefromCPSandITSdomains A state is represented by an (implicitly conjunc- inamachine-readableform(Section2.1). tive)setofpredicates{P ,P ,...}expressingthefacts 1 2 knownaboutthestate. Eachpredicateisacompound Transition1 term that has a form of P(a ,a ,...,a ), where P is i 1 2 n i Precondition Computation Action a predicate’s functor specified as a literal, i.e., a se- is_bus(B) quence of characters, and a |j∈[1..n] are the argu- is_bus_stop(S) less_than(Y, 20) delete(waiting(P, U(Y)) j is_passeger(P) greater_than(C, 0) delete(at(P, S)) ments. The number of arguments n is called arity at(P, S) decrease(C, 1, NC) add(at(P, B)) at(B, S) delete(capacity(B, C)) of the predicate. If n=0, then Pi denotes a simple capacity(B, C) add(capacity(B, NC)) atomicfact.Ifn>0,thenP denotesafactualrelation waiting(P, min(Y)) i betweenitsnarguments.Theargumentsofpredicates Figure2:Anexampleofatransitionspecification. mayinclude: • numbersdenotingliteralquantity; evolvefromstateState tostateState definedinFig- 2 3 • literals denoted by sequence of alphanumeric ure1. Aftermatchingtheprecondition,thecomputa- characters that start from a lower case character tion checks if a passenger has been waiting for less {a,b,c,...} that represent objects or concepts in than20minutesandifthereisenoughcapacitytoon- thedomain(e.g.,carmayrepresent“acar”); boardapassenger,itdecreasesthebuscapacityby1. The action removes the passenger waiting predicate, • compoundtermsoftheformT(a ,a ,...,a )that i 1 2 n updatespassengerlocationandavailablebuscapacity may have one or many arguments, which can value. be numbers, literals or compound terms (e.g., velocity(car,kmh(50)) may stand for “the veloc- ityofthecarcaris50km/h”). Semantics Weformalizesemanticsofliterals,com- pound terms and predicates by associating meanings An example shown in Figure 1 contains a to their symbols. For example, we use the predicate state State defined using a set of six predicates 1 at(p1,bs1)tomodelthefactthatapassenger p1isat {is bus,is bus stop,is passeger,at,capacity,waiting}. thebusstopbs1. Wesaythatthemeaningofat isto The arguments of the first three predicates declare representaclosespacialrelationshipbetweenitstwo existence of bus b25, bus stop bs1, and passenger arguments. p1 accordingly. The fourth predicate states that We define semantics of our knowledge model in passenger p1 is at bus stop bs1. The fifth predicate terms of a transition system. Formally, a transition indicates that bus b25 has 23 available places. The systemisatuple(S,T,→),whereSisasetofstates, last predicate declares a fact that passenger p1 has T isasetoftransitionspecificationnames,and→is beenwaitingatthebusstopfromlasttwominutes. setofstatetransitions(i.e.,asubsetofS×T×S).The Theproceduralknowledgeismodeledasacollec- fact that (State ,Transition ,State )∈→ is written tionofspecificationsofpotentialtransitionsbetween 1 1 2 states. A transition specification consists of a pre- as State −T−ra−n−si−ti−on→1 State , and represents a transi- 1 2 condition, a computation, and an action. Precondi- tion between a source state State and a destina- 1 tionandactionbothhavethesamesyntaxasthestate, tion state State by applying transition specification 2 i.e.,theyarerepresentedasasetofpredicates,except Transition . 1 the following two differences. Variables denoted by Inorderforatransitionspecificationtobeapplied sequencesofalphanumericcharactersstartingfroma its precondition must match the source state and its capitalletter{X,Y,Z,...}areallowedinargumentsof computationmustsucceed. Thesemanticsofmatch- predicatesandcompoundtermsinbothprecondition ing the precondition with a state are formalized by andaction. Theactionpredicatesarerestrictedtothe defining a logical unification between predicates of set {add,delete}. Intuitively, action predicates de- thepreconditionandthepredicatesofthestate,asfol- note the procedures performed with a state when a lows. We unify every predicate in the precondition transition is performed. Computation is an ordered with all the predicates from the state, and use vari- listofeffectfreefunctioncalls,i.e. theydonotmod- ablessubstitutionsinsubsequentunificationofthere- ify the state and are only used during the processing mainingpreconditionpredicates. Iftheunificationof of the transition. The arguments of a function call all precondition predicates with the state predicates maybenumbers,literals,variables,andfunctions. If succeeds, the computed variable substitution is used afunctionreturnsavalue,thelastargumentofafunc- in the computation and the action, as explained be- tioncallisavariablethatholdsit.Theresultofafunc- low. Obviously, there can be multiple matches of a tion call may be used as an argument in subsequent precondition with a source state. In this case, every functioncallsofthecomputationorintheaction. match will produce a transition in → given that the Example in Figure 2 demonstrates specification correspondingcomputationsucceeds. of a transition Transition that allows a system to The meaning of the computation is evaluation of 1 KMARF human sensing Perception Engine predicates Knowledge Base domain and reasoning expertise expertise model meta-reasoning states and transformation expertise transitions rules Reasoner goal query Inference Engine UI d orl user specified w stop planner problem model checker al format problem format goal e R Planner ... Model Checker property proof strategy actuating state changes expected state Actuation Engine Interpreter Figure3:Ahighlevel,conceptualviewofthearchitectureofKMARF. itsfunctionsintheorderofspecification. Weusede- 2.2 Architecture notationalsemanticstodefinethemeaningofafunc- tionF asasetoforderedtuples Afterintroducingtheknowledgemodel,wecanmove ondescribingKMARF.Ahigh-levelconceptualview {<a1,...,a1 ,a1>,...,<am,...,am ,am>}, 1 n−1 n 1 n−1 n of the architecture of the framework is depicted in where ai,...,ai are function arguments, and ai is Figure 3. The main components of KMARF are the 1 n−1 n Perception Engine, the Knowledge Base, the Rea- the value returned by F given those arguments. A soner,theInterpreterandtheActuationEngine. functioncallF(a ,...,a ,a )istheprocessoffind- 1 n−1 n TheKnowledgeBaseisresponsibleforrepresent- ingsucha forgivena ,...,a thatthereisatuple n 1 n−1 <aj,...,aj ,aj >inthedefinitionofF forsome j. ing aspects of the domain under consideration (such 1 n−1 n asobjectsorconcepts,instancesandstates)andtheir Ifthereisnosuchtuplefound,thefunctioncallfails. relations, in well defined, machine processable syn- Otherwise, the function call succeeds and the value of aj is assigned to a corresponding variable. If the tax and unambiguous semantics. The format of the n knowledge stored in the knowledge base complies returned value a is of boolean type, i.e. it belongs n withtheknowledgemodelintroducedinSection2.1, totheset{true,false},thenthefunctionsucceedsif andoneofthepossibleformatsisRDF/OWL.Inad- a =trueandfailsifa = false. Acomputationsuc- n n dition, the knowledge base contains meta-reasoning ceedsifallthefunctioncallsinitsucceed.Otherwise, expertise, as well as model transformation rules that thecomputationfails. aredescribedbelow. The semantics of the transition action execution TheReasonerisusedforsolvingreasoningprob- aredefinedbytwooperations. Thefirstoperationin- lems. By reasoning we mean solving problems re- stantiates predicates in the action by applying com- lated to planning, verification, optimization, etc. By puted variable substitution to them. This means that relating a user query to a meta-reasoning expertise1 all the variables in the action predicates are replaced stored in the knowledge base the Inference Engine withthecorrespondingvaluesfromthevariablesub- draws a conclusion about an appropriate method or stitution. The second operation copies all the pred- a problem solver, and relevant prior knowledge for icates from the source state to the destination state, solving a given problem. For example, if the user and for every predicate in the action we perform the query is to reach a certain goal, the inference en- followingproceduresonthedestinationstate: gine will look up the knowledge base and deduce • iftheinstantiatedpredicatesymbolisadd,thenits that a Planner should be used to generate a strat- argumentistreatedasapredicate,anditisadded egy to reach that goal. Additionally, given that most tothedestinationstate; 1Meta-reasoningisreasoningaboutreasoning,i.e.,itis • iftheinstantiatedpredicatesymbolisdelete,then comprised of computational processes concerned with the itsargumentistreatedasapredicate,anditisre- operation and regulation of other computational processes movedfromthedestinationstate. withinthesameentity(WilsonandKeil,2001). of the planners accept planning problems in Plan- throughout the ontology. This is important because ning Domain Definition Language (PDDL) (Mcder- ontologies often reuse and extend other ontologies. mottetal., 1998)astheirinput, theinferenceengine Updatinganontologywithoutpropercarecanpoten- looks up corresponding model transformation rules tially corrupt the others depending on it and conse- that should be applied to formulate the problem in a quentlyallthesystemsthatuseit. format understandable by the selected planner. The Interpretertakesthegeneratedstrategyandmapsitto 3.1 UpperOntology statechangesthatitgivestotheActuationEngine,so thatitcanperformactuationintherealworld. Upperontologiesshouldbedesignedtodescribegen- Sincethephysicalworldisnotentirelypredictable eral concepts that can be used across all domains. KMARF needs to take into consideration that there They have a central role in facilitating interoperabil- might be changes in the information stored in the ityamongdomainspecificontologies,whicharebuilt knowledge base. The Perception Engine is respon- hierarchically underneath the upper and generic lay- sible,whenneeded,topushnewknowledgefromthe ers,andthereforecanbeseenasspecializationofthe environment(i.e.,predicates)intheknowledgebase. moreabstractconcepts. Additionally, when executing the strategy the Inter- Figure 4 presents a subset of the proposed up- preterworkstightlywiththeReasoner. Incasethere per ontology. Its development was prompted by areanychangesintheexpectedstateofthesystemthe our use cases in management and control of com- ReasonersendsareplanningrequesttothePlanner. plex systems-of-systems, and was inspired by other ontologies such as SUMO (Suggested Upper Merg- erd Ontology) (Niles and Pease, 2001), and W3C 3 TAXONOMY OF ITS DOMAIN SSN(SemanticSensorNetworkOntology)(Compton CONCEPTS etal.,2012). Someimportantconceptsdefinedontheproposed This section describes the objects or the concepts of generalontologyincludeSystem,Cyber-PhysicalSys- ITS domain and their relation to more generic CPS tem,AgentandCPSAgent. ASystemisasetofcon- domain concepts. The concepts are organized in an nected parts forming a complex whole that can also ontology that has multiple layers of abstraction. We be used as a resource by other systems. A Cyber- design our ontology by combining high level con- Physical System is a system with both physical and cepts and cross-domain relationships borrowed from computational components. They deeply integrate three areas: CPS; Agent-Based Model (ABM); and computation, communication and control into phys- Systems-of-Systems (SoS). The proposed ontology icalsystems. AnAgentisasystemthatcanactonits consists of an Upper Ontology, which contains the own, sense the environment and produce changes in CPS, ABM, and SoS concepts and relations and a theworld. Whenanagentisembeddedintoacyber- generalITSDomainOntology. ThegeneralITSDo- physical system it is called a CPS Agent, or cyber- mainOntologycanbefurtherreferencedfromontolo- physicalagent. gies that instantiate transport-domain specific transi- Importantformathematicaldesciptionsofinterre- tionsandstates,asdescribedinSection4. lations between systems are the elements Arc, Node The objective of breaking the ontology into mul- and Graph. Where an Arc is any element of a graph tiple levels is twofold. First, this approach allows that connects two Nodes, while a Graph is a set of to capture and isolate different levels of properties, NodesconnectedbyArcs. attributes and relationships. Higher layers provide TheconceptofSystemcanbefurtherexpandedby broaderdefinitionsandmoreabstractconcepts,while anumberofattributes,suchasCapacity,RoleandCa- lower layers are less abstract and can support spe- pabilitythatcanalsohaverelationshipsamongthem. cific domains and applications with concepts and re- The System itself is represented within the Declara- lations which might not be present in the upper lev- tive Knowledge as an Object. Affordance is a prop- els. Second,ontologiesareexpectedtochange,grow erty the defines the tasks that can be done on a spe- and evolve as new domains and techniques are con- cificSystem,whileCapabilitydefinesthesetoftasks templatedinthem(Daviesetal., 2006). Leavingthe thesystemcanperform. SystemscanalsohaveCon- moreabstractandgeneralconceptsinanupperlayer, straints,whichinturnarerelatedtoKPIsthatareused andthemorespecificonesinlowerlayers,reinforces tomeasurewhethersuchconstraintsaresatisfied. theideathatalteringthemostgeneralconceptsshould The higher level of the proposed ontology also beavoided,makingthemlesslikelytosufferconstant provides definitions and relationships between the modificationsthatcouldleadtounnecessarychanges mainKnowlegdeBaseconcepts, theDeclarativeand Figure6:TheITSDomainOntology. Figure4:Anupperontologyfordomainintegration. centralconceptswithintheITSdomainistheTrans- portAgent, thatextendsAgent fromtheupperontol- ogy. The Transport Agent encompasses agents that arecapableoftransportingsomeentity,rangingfrom physical goods to virtual data. Some important con- ceptsfromtheupperlayersthatapplytotheTransport AgentincludeDynamicsandCapacity,amongothers. Transport Agents in turn are strongly related to the Abstract concept of Transportation Mode which de- fines the type of transportion scenario (e.g., Roads, Figure5:KnowledgeBaserepresentation. Rail,Telco). Another important concept is the Transportation Procedural Knowledge. In our knowledge model, a Infrastructure which encompasses all elements re- Transition is a Procedural Knowledge concept that quired by a Transportation Mode, such as Routes, determines how to achieve a certain state (Action) TracksandTransportationNetworks. Mostelements given that an agent observes a particular state (Pre- within the Transportation Infrastructure are exten- condition) as being true in the world and there is an sionsofGraph,ArcandNode,abstractconceptsfrom ordered list of effect free function calls in that state the Upper ontology. Therefore, by using high level (Computation). Meanwhile, both Precondition and graph definitions it is possible to define most of the ActionhaveaPredicateSet thatisdirectlyrelatedto transportation infrastructure in an ITS Domain. A theconceptofStatefromtheDeclarativeKnowledge. node inside the transportation infrastructure is re- TheGoalState, whichisanspecificationofState, is ferredtoasaPOI(PointofInterest)anditcanbeany relatedtotheconceptsofTaskandWorkflowfromthe desired location within the Transportation Network ProceduralKnowledge. WhereaWorkflowisdefined (e.g., a crossing, a specific point in the route, coor- as sequence of Tasks, which in turn is defined by a dinate,awarehouse,abusstop).ATrafficSemaphore sequence of Goal States assigned to a single Agent. ismodeledasagenericActuator thatisusedtocon- Figure5presentsthemainelementsoftheknowledge trol and regulate traffic and it can be applied in any basemodeling. transportationscenario. 3.2 ITSDomainOntology ATransportableEntityencompassesanyelement thatcanbetransportedbyaTransportAgent,suchas With the support of the presented upper ontology regularCargoornetworkData. AtypicalPassenger model,inthissectionweproposeanITSdomainspe- is also a Transportable Entity and extends the upper cific ontology, as depicted in Figure 6. One of the ontologyconceptofHuman. Knowledge Base Static Data Reusable Data Upper.ttl Reference ITS_Domain.ttl transition_library.ttl Library Entities state_library.ttl Reference User Data TransportPlanner TR.ttl busTransitions.ttl Knowledge Engineer API: busStates.ttl Create New Transition and State File with potential reference to reusable - Transport States and transitions and states Fleet Planner Transition Files for [transition file, state file] - Model Bus Transport domain Transformation Fleet Manager API: Problem and Rules (TR) File Trigger Execution of new Plan Domain File [transition file, state file, TR file] Generator domain_file.ttl Trigger problem_file.ttl Replanning Generated Plan PDDL Executor PDDL Planner, PDDL (third party) Intepreter (third party) Monitor, Actuate Environment: Connected Vehicles, Roadside Sensors and Actuators, … Figure7: Overviewoftheimplementedsystem. The“.ttl”extensiondenotesmodelfilesinTurtleformat. Componentsin dottedrectanglesarethird-party. 4 IMPLEMENTATION particular transport planning problem. The mod- els are described using semantic web technologies and are based on the W3C Web Ontology Language Thissectiondescribescurrentprogresstowardsapro- (OWL)(Hitzleretal.,2012)andstoredinTurtlefor- totypeimplementationoftheKMARFarchitectureil- mat (Beckett et al., 2014). The other component lustrated in Figure 3. The implementation targets a is a PDDL Generator, which, given the transforma- large problem area in ITS known as “transportation tion rules, states & transition files as input, gener- planning”, which we define as the schedules gener- ates a problem and domain file in PDDL language. ated for a set of vehicles to pickup and alight peo- PDDLGeneratorisimplementedinJava(Jamesetal., pleorcargoalongoneormoreroutes,withinagiven 2015) and uses Apache Jena (Apache Foundation, amount of time (see also Section 1). The transport 2016)forparsingtheTurtle-formattedinputfromthe planning problem includes a set of connected vehi- knowledgebase. Additionally,EclipseJetty(Eclipse cles, for example buses or trucks, and a central co- Foundation, 2016) provides a Representational State ordinating function that computes the schedule and transmits it to these vehicles2. In this implementa- Transfer(REST)APIfortriggeringPDDLfilegener- ation,anddefiningcustomstatesandtransitionmod- tionweassumethattheInferenceEnginecomponent els. Morespecifically: has already deduced that a Planner should be used to solve the transportation planning problem, using • The API allows human experts (for example meta-reasoning expertise and user query data sup- knowledgeengineers)tospecifyatransportlogis- pliedfromtheKnowledgeBaseandtheuserinterface ticsproblem,byaddinganewinitialandgoalstate componentsrespectively. intheknowledgebase,intheformofastatefile, Figure 7 shows the components of the imple- and a set of transitions with precondition, com- mentedsystem. Oneofthecomponentsimplemented putation and action parts in the form of a transi- is the Knowledge Base, which contains model trans- tion file. These two files are jointly used by the formationrulesforPDDLlanguageaswellasstates PDDLGeneratorsoftwarecomponentinorderto & transition models that are based on the structure generate a new schedule. The state file defines defined in Section 3 and contain information for the theagents,vehiclesandroutes,containsinforma- 2Correctinterpretationoftheschedulerestsontheve- tionabouttheinitialstateofthesystem(e.g.,the hicles,whichcanbepartiallyorcompletelyautonomousor location of agents in the route, the route and its theymayalsohavehumandrivers. waypoints,thetimerequiredforvehiclestotravel Table1:Knowledgefortransportplangeneration. aroute,etc.) anddefinesgoalconditions(e.g.,all agentsareserviced). Thetransitionsfiledescribes Title Description intermediatetransitionsthatareusedbytheplan- Route Spec- Specification of the route(s) ner to reach the specified goal state from the ini- ification graph(s), which includes vertices tialstate. Anexampleofsuchplancanbefound (coordinates), edges (roads) and at(KMARFauthors,2016). edge-traversal costs, metrics (e.g. • The API also provides means for triggering gen- timetotravel,fuelspent,etc.) eration of a new PDDL problem and domain file Transport Number of vehicles, Vehicle IDs given the above input on request of a human or Agents (e.g.VINcodes)andvehiclecapac- other system. Typically this request is created ity from a customer (e.g., human operator, or an au- tomated fleet management system). Once gen- Transportable NumberandIDoftransportableen- erated, the files are assigned Universal Resource Entities tities Identifiers (URIs). An external system can sub- Starting Where are the vehicles located, sequently perform Hypertext Transfer Protocol Conditions wherearethepassengerslocated (HTTP) GET requests using the URI references Transition What transitions the transport toretrievethefiles. Anexampleofsuchasystem definitions vehicles perform (which include canbeaPDDLsolver3. Forthisimplementation, preconditions, optionally compu- weuseathird-partysolvernamed“OPTIC”,orig- tations and actions) . There are inally developed by Benton et al (Benton et al., currently three actions available 2012). in the library: pickup-agent, drop- The authors have released the current implemen- agent,move-to-next-coordinate tation of the Knowledge Base and PDDL Genera- Goal condi- Final state: what criteria needs to tor as open-source, available for the community to tions besatisfiedinorderforthetransport use (KMARF authors, 2016). Currently, there is no servicetoconcludeonthespecified componenttosupportinteractionwiththerealworld, route (usually this means that all both for triggering the planning process, but also for agentsarepickedup,off-boardedin actuatingreal-worldconnecteddevices(e.g. busesor specificpartsoftheroute). sensors) upon execution of the generated plan, how- ever this is planned work. In its current state the implementation can be used for rapid prototyping of transportation planning functions. In addition to the WedefineCODastheeffortrequiredforformalizing software itself, the “Upper”, “ITS”, “PDDL model theknowledgerequiredinorderforthesystemtostart transformation rules” and a set of common reusable theautomatedtransportschedulegenerationprocess. transitionsandstateontologiesareprovidedinTurtle Naturally, there exists a direct relationship between format. theamountofknowledgetobeformalizedandtheef- fort required, meaning that the more the amount of non-formalizedtransportplan-relatedknowledge,the 5 EVALUATION moretherequiredeffort(e.g. intermsoftime,human resource allocation, money etc.). Table 1 shows the Inthissection,weevaluatetheimplementedsystemin differentaspectsofknowledgerequiredforthetrans- termsofreusability. Giventhepracticallimitationof portationplan.AsdescribedinSection3,weviewthe nothavingarealorsimulatedtestbedofconnectedve- transport network as a graph, with Points of Interest hiclesasdescribedintheprevioussection,itisnotyet (POIs) as vertices on the graph and POI-connecting possibletoevaluatesomeaspectsofthesystem(e.g. roadsasedges. Notethatthetablereferences“trans- efficiency, performance, etc.) in realistic conditions. portable entities”. These entities can be passengers Whatwedescribeinsteadisanevaluationoftheben- or cargo, depending on the use case. An interesting efits this system brings on “cost-of-design” (COD). observationcanbemaderegardingtransitions,which are similar regardless of the route, number and type 3In its current form, the API does not support adding of transport agents (e.g., buses or trucks) and trans- ofnewmodeltransformationrules,whichmeansthatonly portable entities. Therefore, reusing these actions PDDL language is supported. In the future however, we acrossdifferenttransportplanningusecases,andstor- plan to expand the functionality by adding support for “pluggable”problemsolvingexpertisefiles,bothforPDDL ingthemaspartofthe“transitionlibrary”(seeFigure andProlog. 7),issomethingthatcanpotentiallyreduceCOD. TomeasuregainsinCOD,wehavedefinedasim- codeknowledgethemselves,ratherthanusingknowl- plemetricwenamed“reusabilityindex”. Thismetric edgeengineers. TheconceptualmodelofKEWIcon- istheratioofreusedentities,versustheratiooftotal sists of three main parts: an ontology for describing entities in the knowledge input to PDDL Generator entitiesthatoccurinthecaptureddomain,amodelof to generate the plan. For the bus use case, this ratio primitive rules (called actions) that can be executed was 0.364 and for the truck use case, the ratio was bythesystemandhigh-levelmethodsforaccomplish- 0.251. This means that out of the total number enti- ing complex tasks. KEWI is specifically developed ties created for each of the bus and truck use cases, for planning problems, whereas our framework tar- 36.4% and 25.1% of them were already available in gets different classes of reasoning problems by shar- thelibraryrespectively. Weobservethatbothindices ing the same underlying state representation, as for- arerelativelysignificant,whilethedifferencebetween malizedinourknowledgemodel. the two is mainly attributed to the difference of the TheitSIMPLEtoolwasfirstproposedinVaquero route specification entities, as agents in both routes et al. (Vaquero et al., 2005) for supporting the cre- followed different paths. One observation that we ation of generic planning systems by integrating do- have made a posteriori to our measurements, is that mainandproceduralknowledge,whileautomatically thereusabilityindexcanbelarger,iftheroutespecifi- generatingPDDL(Mcdermottetal.,1998)files.They cationispartofthePDDLGenerator,whichcanauto- proposeusingUMLformodelingdomainknowledge maticallygeneratethespecificationusingdatafroma and Petri Nets for modeling the procedural knowl- mappingserviceinconjunctionwitharoutinglibrary. edge regarding feasible state transitions, while us- The knowledge engineer could then only specify the ing XML as an internal language. The tool has desiredwaypoints(e.g.,thebusstops),andtheroutes since evolved (Vaquero et al., 2012) and has been and graphs would be generated automatically by the demonstratedinseveralcross-domainusecases,such PDDLGenerator. Wearecurrentlyintheprocessof as petroleum plant operations planning (Sette et al., evaluatingdifferentmappingservicessuchasGoogle 2008). MapsandOpenStreetMapandopen-sourceroutingli- In fact, when developing a framework that in- braries such as GraphHopper and DirectionsService tendstocombineknowledgeengineeringwithmulti- fortheirapplicabilityinourimplementation. pledeclarativeandproceduralreasoningclasses(such as semantic reasoning and planning) one important choice to make is the language (or languages) used 6 RELATED WORK to model problems and the required information for solvingthem. In(Anisetal.,2014)theauthorscom- Asmallnumberofframeworksexistthatsupportthe parethreeclassicallanguagesformodelingproblems formalization of declarative and procedural knowl- in the cyber-physical production systems, namely: edge. In (Vaquero et al., 2011) the authors present Prolog, Timed Automata (Alur and Dill, 1994) and an overview of tools and methods in KEPS (Knowl- PDDL.Eachlanguagehasitsprosandcons,andcan edgeEngineeringforPlanningandScheduling)area. be used for solving different reasoning problems. In They classify the process of knowledge engineering KMARF we provide a “glue” knowledge model that intosixphases: RequirementsSpecification, Knowl- depending on the reasoning problem to be solved is edgeModeling,ModelAnalysis,DeployingModelto intended to be translated to other languages, such as Planner, Plan Synthesis and Plan Analysis and Post- Prolog,TimedAutomataorPDDL. Design. Thentheyprovidealistoftoolsandmethods Anotherrelatedfield ofworkisthearea ofstudy thatareusedintheliteratureateachofthosephases. dealingwithcognitivearchitectures,whichareframe- When commenting on these tools, the authors men- works that specify the underlying infrastructure for tion that to that moment none of them treated dif- an intelligent system and include aspects of a cog- ferently the knowledge encapsulated in the planning nitive agent that are constant over time and across problemandinthesurroundingdomain,whichmakes different application domains (Langley et al., 2009). ithardertoreuseknowledgeinotherdomains.Incon- Assuch,theyoftenincludememorymechanismsfor trast,thegoalofKMARFistoexactlysupportreuse storing and processing different types of knowledge, of knowledge, by relying on a common knowledge e.g., procedural, semantic and episodic knowledge. modelacrossdifferentdomains. Thisknowledgeisusedasthebasisforactionselec- KEWI(Wickleretal.,2015)isaknowledgeengi- tion, which can be reactive, based on planning or a neeringtoolthathasbeendesignedtohelptheformal- hybrid of these two. There are many cognitive ar- ization of a procedural knowledge used for planning chitectures (Samsonovich, 2010), each with its own problems. Theideaistoenabledomainexpertstoen- strategies and constraints when dealing with plan- ning, acting, sensing and knowledge management. ation of such systems. We have illustrated the usage Some of the most notorious ones are SOAR (Laird, ofpartsofKMARFonanimplementationofagener- 2012) and CLARION (Licato et al., 2014). In atingtransportplanner, whichcanbeusedtorapidly SOAR, for instance, procedural knowledge is repre- prototypeschedulersofvehicletransportfleets. sentedbyif-thenrulesinamannersomewhatsimilar Therearecurrentlymanydifferentabstractionsin to the STRIPS (Stanford Research Institute Problem theliteratureforhandlingthedesignofcomplexreal- Solver)/PDDLformalism,whilesemanticknowledge world systems, including Cyber-Physical Systems, abouttheworldisrepresentedinagraphheldinwork- Agent-Based Model, and Systems-of-Systems engi- ingmemory. CLARIONontheotherhandemploysa neering,eachofthemaccompaniedbytheirownfor- hybrid approach by integrating a rule based system malisms and theory. Our vision is that we can pro- with artificial neural networks. KMARF has a num- videbettersupportforlinkingcross-domainusecase berofsimilaritieswhencomparedtocognitivearchi- applications by integrating the common elements of tectures. For instance, KMARF intends to improve thoseformalismsviaourknowledgemodel. re-usabilityacrossdifferentdomains, whichisalsoa IntheimplementationofKMARFwehavesofar natural feature in biologically-based cognitive archi- progressed into the development of an ontology for tectures.Anothersimilarityisinknowledgerepresen- theknowledgebaseusingOWLWebOntologyLan- tationsincemostcognitivearchitecturesalsoorganize guage, and we have used the framework to automat- knowledge into either declarative memory or proce- icallygeneratePDDLfiles,feedthemintoaplanner, dural memory. Finally, intelligent agents based on andcreateplans. Since, KMARFhasamuchbigger cognitive architectures are also known for perform- vision than solving planning problems, in the future ing a range of reasoning tasks such as planning and weplanonstudyinghowourknowledgemodelcanbe verification. correlatedtootherformalismse.g.,TimedAutomata. InourefforttoprovideKMARFwiththecapabil- Asfuturework, wealsoplantostudyhowmeta- itytoreasonaboutproblemsindifferentdomains,we reasoningcanhelpKMARFtodeterminewhichprior have included in it a CPS based ontology which de- knowledge and algorithms are relevant when a new, scribes the relationships among CPS concepts. This problemorunforeseeninstancearrives.Suchinstance approach of using ontologies to increase generality corresponds to the current state of the world, along is well known and improves KMARF’s capability to with all current available sensory information. Ini- reuse knowledge in different domains. One exam- tially,thesystemonlyknowshowtosolveproblemsit ple of related work can be seen in covering Multi- hasseenbeforeandhadpreviouslyfoundreductions AgentSystem(MAS)andCPS,ashasbeenexplored that could be solved separately using known proce- in (Lin et al., 2010), where a MAS-based semantic dures. Ifitcannotfindsuchareductionforanewin- modeling approach to CPS in the water distribution stance,itmustrecurtospacestateexplorationforgen- domainwasdescribed. Thegoalwastodynamically eratingasequenceofstatetransitionsthateitherlead integrate information from sensor networks with se- tothespecifiedgoalstateortoabetterstateinwhich manticservicestosupportreal-timedecision-making. eitherthesystemknowshowtoproceedwithfurther Two challenges were effectively addressed when de- reductions or declares the problem as intractable un- signingtheontology: modelaccuracyandintegration deritscurrentknowledge. of physical and cyber components; and pinpointing inter-dependenciesbetweenCPScomponents. References 7 CONCLUSION Alur,R.andDill,D.L.(1994).Atheoryoftimedautomata. TheoreticalComputerScience,126(2):183–235. Anis,A.,Schfer,W.,andNiggemann,O.(2014). Acom- Inthispaper, wehavepresentedconceptsandstrate- parison of modeling approaches for planning in Cy- gies for creating a model for representing knowl- berPhysicalProductionSystems. InProceedingsof edge from CPS and ITS domains in a machine- the2014IEEEEmergingTechnologyandFactoryAu- readable form, as well as KMARF, a generic frame- tomation(ETFA),pages1–8. workforknowledgemanagementandautomatedrea- ApacheFoundation(2016). ApacheJena: Afreeandopen soning, integrating this knowledge model. The mo- sourceJavaframeworkforbuildingSemanticWeband tivation behind the creation of the knowledge model LinkedDataapplications. and KMARF is to demonstrate how knowledge and Baral, C. (2003). Knowledge Representation, Reasoning, methods across different domains can be reused to and Declarative Problem Solving. Cambridge Uni- reduce costs of development, deployment and oper- versityPress,NewYork,NY,USA.