

{"id":249,"date":"2013-04-18T18:05:52","date_gmt":"2013-04-18T16:05:52","guid":{"rendered":"https:\/\/project.inria.fr\/pyecdar\/?page_id=249"},"modified":"2013-04-18T21:46:31","modified_gmt":"2013-04-18T19:46:31","slug":"adaptive-system-tutorial","status":"publish","type":"page","link":"https:\/\/project.inria.fr\/pyecdar\/adaptive-system-tutorial\/","title":{"rendered":"Adaptive system tutorial"},"content":{"rendered":"<p>Inside the python shell:<br \/>\n<strong><strong>Loading the tool<\/strong>:<\/strong><\/p>\n<p><code>from pyecdar import loadModel<\/code><\/p>\n<p><strong>Loading the model into the workspace:\u00a0<\/strong><\/p>\n<p>Choose a workspace name (for instance W), and load a UPPAAL model from an XML file. We load the routing protocol model described in the <a title=\"Routing protocol\" href=\"https:\/\/project.inria.fr\/pyecdar\/routing-protocol\/\">example section<\/a>.<\/p>\n<p><code>W = loadModel(\"routing_protocol.xml\")<\/code><\/p>\n<p><strong>Load a timed game associated to a template:<\/strong><\/p>\n<p>A UPPAAL model file generated may contain several templates, each described by Timed Input\/Output Automata (TIOA) or Feature Timed Game Automata (FTGA). Each template defines a timed specification or timed game that can be loaded inside the shell and assign to a variable. For timed games we need to provide a <a title=\"Queries\" href=\"https:\/\/project.inria.fr\/pyecdar\/queries\/#tadactl\">T-AdaCTL formula.<\/a><\/p>\n<p><code>G = W.getTimedGame(\"Protocol\", \"A[]([not safe] not RoutedSafe)\")<\/code><\/p>\n<p style=\"text-align: justify;\">This creates a game structure composed by a FTGA and a T-AdaCTL formula on which the user can performs analysis. The formula checks that whenever the environment is not safe, then the protocol is not in the RoutedSafe location.<\/p>\n<p>To solve the game the user launch the command <code>G.solve()<\/code>. This prints as a results the sets of features that allow to win the game from the initial state:<code><br \/>\nChecking formula 'A[]([not Fe[0]] not RoutedSafe)' in template 'Protocol'<br \/>\n=== Winning features ===<br \/>\n(not preconf and not treconf and encrypt) or (not preconf and treconf) or (preconf)<\/code><\/p>\n<p>Therefore this property is satisfied in three conditions:<\/p>\n<ul>\n<li>when the adaptive features <code>encrypt<\/code> is enable<\/li>\n<li>when the system <code>treconf<\/code> is enable<\/li>\n<li><code>when the system\u00a0<code>preconf<\/code> is enable<\/code><\/li>\n<\/ul>\n<p>Additionaly the user can extract a BDD with the sets of winning features:<\/p>\n<p><code>G.get_winning_features()<\/code><\/p>\n<p>This returns an object from the PyCUDD library that can be used for further analysis.<\/p>\n<p><strong>Another timed game:<\/strong><\/p>\n<p><code>G = pytiga.TimedGame(P,\"A[]([safe] not Received or (A&lt;&gt;[0,20](Ready)))\")<\/code><\/p>\n<p>The formula means that if the environment is safe in location Received then the location Ready is reached within 20 time units.<\/p>\n<p><code>G.solve()<br \/>\nChecking formula 'A[]([safe] not Received or (A&lt;&gt;[0,20](Ready)))' in template 'Protocol'<br \/>\n=== Winning features ===<br \/>\n(~preconf and ~encrypt) or (preconf)<br \/>\n<\/code>This property is only satisfied if the system feature\u00a0<code>preconf<\/code> is enable, or if the adaptive feature\u00a0<code>encrypt<\/code> is initially disable.<\/p>\n<p><strong>A third game:<\/strong><\/p>\n<p><code>G = pytiga.TimedGame(P,\"A[](([not safe] not RoutedSafe) and ([safe] not Received or (A&lt;&gt;[0,20](Ready))))\")<\/code><\/p>\n<p>The formula is a combination of the two previous objectives.<\/p>\n<p><code>G.solve()<br \/>\nChecking formula 'A[](([not safe] not RoutedSafe) and ([safe] not Received or (A&lt;&gt;[0,20](Ready))))' in template 'Protocol'<br \/>\n=== Winning features ===<br \/>\n(preconf)<br \/>\n<\/code><\/p>\n<p>The results shows that this property is only satisfied if the system feature\u00a0<code>preconf<\/code> is enable.<\/p>","protected":false},"excerpt":{"rendered":"<p>Inside the python shell: Loading the tool: from pyecdar import loadModel Loading the model into the workspace:\u00a0 Choose a workspace name (for instance W), and load a UPPAAL model from an XML file. We load the routing protocol model described in the example section. W = loadModel(&#8220;routing_protocol.xml&#8221;) Load a timed game associated to a template: &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/project.inria.fr\/pyecdar\/adaptive-system-tutorial\/\">Continue reading<\/a><\/p>\n","protected":false},"author":235,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-249","page","type-page","status-publish","hentry","nodate","item-wrap"],"_links":{"self":[{"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/pages\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/users\/235"}],"replies":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":7,"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/pages\/249\/revisions"}],"predecessor-version":[{"id":365,"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/pages\/249\/revisions\/365"}],"wp:attachment":[{"href":"https:\/\/project.inria.fr\/pyecdar\/wp-json\/wp\/v2\/media?parent=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}