メインコンテンツ

要件のモデル化と検証

要件をモデル化し、Requirements Table ブロックを使用して整合性と完全性を解析する

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

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

Simulink Design Verifier™ を使用して形式的要件を解析し、要件が完全で整合性があることを確認します。テストの生成や仕様モデルの検証の前に形式的要件を検証します。

テストを生成して Requirements Table ブロックで要件を検証することもできます。詳細については、テストを使用した要件の検証を参照してください。

ブロック

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

関数

すべて展開する

slreq.modeling.createRequirements Table ブロックを含む新しいモデルを作成する (R2022a 以降)
slreq.modeling.findFind Requirements Table blocks (R2022a 以降)
slreq.load要件セット、リンク セット、または Requirements Table ブロックの読み込み
anyValueSuppress incompleteness issues for output in Requirements Table block (R2024a 以降)

演算子

すべて展開する

時相論理

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 に変換する
plusRequirements Table ブロックで string を連結する

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

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
strlengthRequirements Table ブロックで string の長さを判別する
containsRequirements Table ブロックで string に部分文字列が含まれているかどうかを判別する

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

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

文字列の編集

eraseRequirements Table ブロック内の string の部分文字列を削除する
eraseBetweenDelete substring between start and end points in Requirements Table block
extractAfterRequirements Table ブロック内の位置の後にある部分文字列を抽出する
extractBeforeRequirements Table ブロック内の位置の前の部分文字列を抽出する
insertAfterInsert string after substring in Requirements Table block
insertBeforeInsert string before substring in Requirements Table block
lowerRequirements Table ブロックで string を小文字に変換する
upperRequirements Table ブロックで string を大文字に変換する
reverseRequirements Table ブロックで string に含まれている文字の順序を逆にする
stripRequirements Table ブロックで string から先頭および末尾の文字を削除する
strtrimRequirements Table ブロックで string から先頭および末尾の空白を削除する

文字列の比較

matchesRequirements Table ブロックで 2 つの string が一致しているかどうかを判別する
strcmpRequirements Table ブロックで string を比較する (大文字小文字の区別あり)
strcmpiRequirements Table ブロックで string を比較する (大文字小文字の区別なし)
strncmpRequirements Table ブロックで string の最初の N 文字を比較する (大文字小文字の区別あり)
strncmpiCompare first N characters of strings in Requirements Table block (case insensitive)

オブジェクト

すべて展開する

RequirementsTableRequirements Table ブロックの構成 (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

トピック

要件の作成

評価ロジックの定義

Requirements Table ブロックのプロパティの構成

データの構成

要件の検証

トラブルシューティング

Debug Requirements Table Blocks

Debug Requirements Table blocks by using breakpoints and analyzing block data during simulation. (R2023a 以降)

注目の例