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

📄 checkeu.m

📁 CheckMate is a MATLAB-based tool for modeling, simulating and investigating properties of hybrid dyn
💻 M
字号:
function EfUg = checkEU(f,g)% Evaluate the `computation tree logic (CTL)` expression "E f U g". %% Syntax:%   "EfUg = checkEU(f,g)"%% Description:%   Given a finite-state transition system and its reverse transition system%   stored in the global variables "GLOBAL_TRANSITION" and%   "GLOBAL_REV_TRANSITION" and "region" objects "f" and "g", compute the%   region "EfUg" corresponding to the CTL expression "E f U g".%% Implementation:%   "GLOBAL_REV_TRANSITION" is a cell array of whose "i"-th entry is a%   vector of source states for each state "i" in the transition%   system. "checkEU()" uses a similar algorithm to the function "reach()"%   to find the set of states reachable from the region "g" in the reverse%   transition system along the paths in the region "f".%% See Also:%   region,auto2xsys,reach,findSCCf,checkAF,checkAG,checkAR,checkAU,checkAX,%   checkEF,checkEG,checkER,checkEX% Note that the REVERSE transition must be given for the result to be% correct!% global global variablesglobal GLOBAL_REV_TRANSITION% local global variablesglobal VISITED REGION_FN = length(GLOBAL_REV_TRANSITION);REGION_F = f;VISITED = region(N,'false');% perform depth first search using the reverse transition% from all states in region g along the paths where f is truefor i = 1:N  if isinregion(g,i) && ~isinregion(VISITED,i)    visit(i);  endendEfUg = VISITED;return% -----------------------------------------------------------------------------function visit(node)% global global variablesglobal GLOBAL_REV_TRANSITION% local global variablesglobal VISITED REGION_F% Mark current node as "visited"VISITED = set_state(VISITED,node,1);% Visit all unvisited childrenparents = GLOBAL_REV_TRANSITION{node};for j = 1:length(parents)  if ~isinregion(VISITED,parents(j)) && isinregion(REGION_F,parents(j))    visit(parents(j))  endendreturn

⌨️ 快捷键说明

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