## 4 A SCS Model Based on FaaS-FR  
Figure 5 shows the proposed FaaS-FR model which is applied to the SCS of a service robot. The functions are categorized according to cognitive functions for allocation according to functionality. The modular functions with a dotted line are offloaded to a public robot cloud or a fog robot server. The applications for the functions use APIs of PaaS or SaaS of the cloud and fog server. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Computing Type** & **Functional Parts** & **Service Levels** \\ \hline Public robot cloud & HPP & PaaS, SaaS \\ Fog robot server & PSP & PaaS, SaaS \\ Edge & OS, SAP & - \\ \hline \hline \end{tabular}  
PaaS: platform as a service; SaaS: software as a service.  
\end{table} 
Table 1: The characteristics computing of FaaS-FR. Figure 4: Various distribution of robot functions and offloading levels: (**a**) stand-alone type; (**b**) and (**c**) use private servers for offloading computation burden; (**d–f**) adopt clouds. The proposed FaaS-FR adopts model (**e**). In the memory of the SCS, the sentential memory stores a series of sentences describing cognitive information of events as shown in Table 2[9]. When an event occurs in a module, the system converts the cognitive information of the event to a sentential form and stores it in a sentential memory. Each sentence has a modular and time tags for being used to query the memory for reasoning. SCS uses an object descriptor to store the features of objects, such as labels, shapes, and current poses, for expressing visual events. The motion descriptor stores the information of physical actions of the robot hierarchically [23]. Each module of the memory is related to the privacy and security and indispensable for the essential functions of robots. In the view of FaaS-FR, the memory modules can be worked on the edge when the computing power is enough. If the computing power of the edge is limited, the task of the module can be moved to the fog robot server. The event manager controls the interpretation and reasoning of events. The event interpreter interprets the cognitive information obtained from the modules and creates sentences. The event manager stores the sentences in the sentential memory. Schematic imagery is an imitation of a human mental model for spatial reasoning. If the SCS needs a reasoning of the visual situation at a certain time, it produces a virtual scene by placing the models of the objects and derives sentences that express the spatial context of the scene. The cognitive grammar database (CGDB) has grammar rules to generate sentences from the cognitive information of the events. For the purpose of FaaS-FR, the function of the \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{\#} & \multirow{2}{*}{**Time**} & \multirow{2}{*}{**Module**} & \multicolumn{6}{c}{**Sentence**} \\ \cline{3-8}  & & & **VERB** & **AUX** & **ARG1** & **ARG2** & **SPACE** & **TIME** \\ \hline
1 & \(t_{1}\) & VM & appeared & - & (NP A cup) & - & (PP at (NP \(x,y,z\))) & \\ \hline
2 & \(t_{2}\) & LM & move & - & - & (NP the cup) & (PP to (NP the front)) & - \\ \hline
3 & \(t_{3}\) & MM & picked up & - & (NP I) & (NP the cup) & - & - \\ \hline \multicolumn{8}{l}{AUX: auxiliary verb; ARG: argument; VM: vision module, LM: listening module, MM: motion module; NP: noun phrase; PP: propositional phrase.} \\ \end{tabular}
\end{table} 
Table 2: Examples of sentences stored in sentential memory. Figure 5: The block diagram of the sentential cognitive system (SCS) based on FaaS-FR that offloads the computation of modules. CGDB: cognitive grammar database; TTS: text-to-speech. event manager is essential for the robots to work properly. Therefore, the modules can be worked on the edge or in the robot fog servers. There are perception and behavior modules linked to and from the external world in the lower part of Figure 5. The vision module is used to recognize visual events by capturing scenes by a camera and recognizing objects.