⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unroll.tex

📁 由matlab开发的hybrid系统的描述语言
💻 TEX
字号:
\chapter{Unrolling the Items}\label{unroll_c}Some of the statements in the \hysdel{} grammar are too powerful for direct translation into an \MLD{} system. Thesolution in these cases is to split the statement into two items. We call this process unrolling.Unrolling is done by calling \method{Section}{unroll}. It modifies the original items produced by the parser andcreates new items. It does this by calling \method{Item}{unroll} for all its items. The items in turn ask theirexpressions to unroll themselves by calling \method{Expr}{unroll}. Then they add their own unrolled items, if theyhave one. \method{Expr}{unroll} unrolls its children (if it has any) and can then add another unrolled item, if itwants to. The following sections discuss all possible unrolls and table~\ref{unroll_table} gives a short summary.\begin{table}\begin{center}\begin{tabular}{lm{36mm}l}location & problem & solution \\\hlineDA & condition is complex & LOGIC: add = logic \\Cont. OUTPUT, CONTINUOUS & affine expr. contains constant term & LINEAR: add = const\\Logic OUTPUT, AUTOMATA & logic expr. is complex & LOGIC: add = logic\\Expr: cast Bool to real & logic expr. is complex & LOGIC: add = logic \\\end{tabular}\end{center}\caption{When and how unrolling is done} \label{unroll_table}\end{table}\section{Casting real to Boolean}Using the keyword REAL, it is possible to cast a Boolean expression in a real one. If the expression being castedis a Boolean variable, the variable can be treated just like a real variable. There is no problem when translatinginto \MLD{}. If the cast is done on a complex Boolean expression (one containing Booleanoperators), this is no longer possible. The solution is to replace the Boolean expression in the\cppclass{Cast\_log2real\_expr} with an additional Boolean variable. That variable is set in a newly created logicitem.\section{DA converter with complex condition}Recall the syntax of the DA converter: \\\hspace*{1cm} \code{lhs\_var = IF cond THEN affine\_then[mme\_then] [ELSE affine\_else [mme\_else]];} \\The DA converter can only be translated into \MLD{} inequalities, if the condition \code{cond} is a single Booleanvariable. However, the \hysdel{} grammar allows complex Boolean expressions. In that case, \code{cond} is replacedwith an additional Boolean variable. The \cppclass{DA\_item} stores this variable in its field \code{cond\_var}.Then, a new logic item is constructed which assigns \code{cond} to that variable.\section{Affine term in \MLD{} equality}\label{affine_in_eq_s}Statements in the CONTINUOUS section and real OUTPUT statements can assign an affine function (with a constantterm $c$) to the left hand side variable. The \MLD{} equalities allow only linear assignments. Thus, the constantpart $c$ is removed and instead an additional variable is added. This variable is set by a new linear item to $c$.An extended \MLD{} representation (see section~\ref{B5D5}) can have constants in the equalities. If that versionis used (specified by the \cmdop{5} command line option), the unrolling described in this section is notnecessary.\section{Logic expressions in \MLD{} equality}In the AUTOMATA section and in the Boolean OUTPUT, Boolean variables are set using the \MLD{} equalities. Anequality can only set the left hand side variable to some other Boolean variable. Complex Boolean expression, asthey are allowed in the \hysdel{} grammar, cannot be assigned. The solution is to create a new logic item thatassigns the Boolean expression to an additional variable. \cppclass{Automata\_item} and\cppclass{Logic\_output\_item} store this variable in their field \code{upd\_var}.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -