Main Content

Simulink モデル内の要件の形式化

Requirements Table ブロックを使用してシミュレーションの実行前および実行中にロジックを評価

Requirements Table ブロックを使用して実行前および実行時にロジックを評価することで、Simulink® モデル内の形式的要件を定義します。形式的要件を使用して、モデルの出力をチェックするかブロック出力を実行します。

形式的要件は、要件エディターのブロックで直接設定するか、MATLAB® でプログラムのコマンドを使用して設定します。

ブロック

Requirements Table入力条件を使用した形式的要件のモデル化 (R2022a 以降)

関数

すべて展開する

slreq.modeling.createCreate new model with Requirements Table block (R2022a 以降)
slreq.modeling.findFind Requirements Table blocks (R2022a 以降)
slreq.load要件セットまたはリンク セットの読み込み
anyValueSuppress incompleteness issues for output in Requirements Table block (R2024a 以降)

オブジェクト

すべて展開する

RequirementsTableConfigure Requirements Table blocks (R2022a 以降)
SymbolRequirements Table ブロックのデータを構成する。 (R2022a 以降)
RequirementRowRequirements in Requirements Table block (R2022a 以降)
AssumptionRowAssumptions in Requirements Table block (R2022a 以降)

オブジェクト関数

すべて展開する

ブロック データの管理

addSymbolAdd data to Requirements Table block
findSymbolRetrieve data in Requirements Table block

ブロック行の管理

addAssumptionRowAdd assumption to Requirements Table block
addRequirementRowAdd requirement to Requirements Table block
addChildAdd child requirement or assumption to Requirements Table block
getRequirementRowsRetrieve requirements in Requirements Table block
getAssumptionRowsRetrieve assumptions in Requirements Table block
getChildrenRetrieve child requirements and assumptions in Requirements Table block
slreq.getCurrentObjectGet selected objects in Requirements Editor, Requirements Browser, or Requirements Table block
clearClear row in Requirements Table block
removeRowRemove Requirements Table block row

ブロック列の管理

hideAssumptionColumnHide Precondition column in Assumptions tab
hideRequirementColumnHide columns in Requirements tab
showAssumptionColumnShow Precondition column in Assumptions tab
showRequirementColumnShow columns in Requirements tab

演算子

すべて展開する

時相論理

durationTime during which condition is valid in Requirements Table block
getPreviousRequirements Table ブロックの前のデータ値
isStartupWhether simulation time is 0 in Requirements Table block
tRequirements Table ブロックのシミュレーションの経過時間

変更の検出

hasChangedDetect change in data since last time step in Requirements Table block
hasChangedFromDetect change in data from specified value in Requirements Table block
hasChangedToDetect change in data to specified value in Requirements Table block

文字列の作成、連結、変換

str2doubleRequirements Table ブロックで string を倍精度値に変換する
stringRequirements Table ブロックで値を string に変換する
plusConcatenate strings in Requirements Table block

文字列のプロパティの決定

isletterDetermine which characters are letters in Requirements Table block
isspaceDetermine which characters are spaces in Requirements Table block
isstringDetermine if input is string in Requirements Table block
strlengthDetermine length of string in Requirements Table block
containsRequirements Table ブロックで string に部分文字列が含まれているかどうかを判別する

文字列の文字の検出と置き換え

containsRequirements Table ブロックで string に部分文字列が含まれているかどうかを判別する
endsWithRequirements Table ブロックで string が部分文字列で終了しているかどうかを判別する
matchesDetermine if two strings match in Requirements Table block
replaceRequirements Table ブロックで部分文字列を検索して置き換え
replaceBetweenReplace substrings between start and end points in Requirements Table block
startsWithRequirements Table ブロックで string が部分文字列で開始しているかどうかを判別する
strfindRequirements Table ブロックで string 内の部分文字列を検索する
strrepFind and replace substrings in Requirements Table block

文字列の編集

eraseDelete substrings within strings in Requirements Table block
eraseBetweenDelete substring between start and end points in Requirements Table block
extractAfterExtract substring after position in Requirements Table block
extractBeforeExtract substring before position in Requirements Table block
insertAfterInsert string after substring in Requirements Table block
insertBeforeInsert string before substring in Requirements Table block
lowerConvert string to lowercase in Requirements Table block
upperConvert a string to uppercase in Requirements Table block
reverseRequirements Table ブロックで string に含まれている文字の順序を逆にする
stripRequirements Table ブロックで string から先頭および末尾の文字を削除する
strtrimRequirements Table ブロックで string から先頭および末尾の空白を削除する

文字列の比較

matchesDetermine if two strings match in Requirements Table block
strcmpRequirements Table ブロックで string を比較する (大文字小文字の区別あり)
strcmpiRequirements Table ブロックで string を比較する (大文字小文字の区別なし)
strncmpCompare first N characters of strings in Requirements Table block (case sensitive)
strncmpiCompare first N characters of strings in Requirements Table block (case insensitive)

トピック

要件の作成と管理

要件データの設定

要件があるモデルのテスト

トラブルシューティング

Debug Requirements Table Blocks

Debug Requirements Table block requirements during simulation. (R2023a 以降)