Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
d0acf212
Commit
d0acf212
authored
Apr 13, 2021
by
Maxime Perrotin
Browse files
Update templates for model checking
parent
bda33792
Changes
3
Hide whitespace changes
Inline
Side-by-side
templates/concurrency_view/simulation-adb/node.tmplt
View file @
d0acf212
...
...
@@ -13,7 +13,7 @@ with Simulator;
with
@
_CAPITALIZE
:
Block_Names_
@
_Events
;
@@
END_TABLE
@@
--
with
ASN1_GSER
;
with
ASN1_GSER
;
--
use
ASN1_GSER
;
package
body
Simulator_Interface
is
...
...
@@ -39,6 +39,9 @@ package body Simulator_Interface is
Update_State (Full_State, User_State);
-- Initialize the state graph with the startup event
ES.Backup_Ctxt := Full_State;
ES.Backup_Hash := ES.State_Hash (Full_State);
ES.Start_Hash := ES.Add_To_Graph (Startup_Event);
ES.Queue.Append (ES.Start_Hash);
...
...
@@ -50,6 +53,7 @@ package body Simulator_Interface is
procedure Run_Exhaustive_Simulation
is
Start_Time : constant Time := Clock;
Iterations : integer := 0;
begin
if not Init then
Put_Line ("Error: you must call Startup function first");
...
...
@@ -57,9 +61,12 @@ package body Simulator_Interface is
end if;
while ES.Queue.Length > 0 and ES.Properties.Length < 10 loop
exit when iterations = 4;
Iterations := Iterations + 1; -- debug
Full_State :=
ES.Grafset.Element (Key => ES.Queue.Last_Element).Context;
-- Put_Line ("Restored: " & System_State_Pkg.Image (Simulator.State));
User_State := Application_State (Full_State);
Put_Line (State_As_String (Full_State));
ES.Queue.Delete_Last;
Exhaust_All_Interfaces;
end loop;
...
...
@@ -187,6 +194,15 @@ package body Simulator_Interface is
--
for
(
6
):
Unused_Hash
:=
ES
.
Add_To_Graph
(
Event
,
Id
,
Stop_Condition
);
Put_Line
(
"State:"
);
Put_Line
(
State_As_String
(
Full_State
));
Put_Line
(
"hash: "
&
Unused_Hash
'Img & " In Grafset: " & ES.Grafset.Contains (Key=>Unused_Hash)'
Img
);
Put_Line
(
"ES Queue Length : "
&
ES
.
Queue
.
Length
'Img);
Put_Line("Stop Condition = " & Stop_Condition'
img
);
Put_Line
(
"ES.Visited.Contains(Hash)? "
&
ES
.
Visited
.
Contains
(
Unused_Hash
)
'Img);
-- Restore the full state (to get the observer in original state for the next iteration
Full_State := ES.Backup_Ctxt;
-- Put_Line ("ES_Callback: " & System_State_Pkg.Image (Simulator.State));
-- Put_Line ("Number of states after Add_To_Graph: " & ES.Grafset.Length'
Img
);
...
...
templates/concurrency_view/simulation-ads/node.tmplt
View file @
d0acf212
...
...
@@ -11,6 +11,7 @@ generic
with
function
Application_State
(
Full_State
:
State_With_Observers
)
return
asn1SccSystem_State
is
<>;
with
procedure
Update_State
(
Full_State
:
in
out
State_With_Observers
;
Application_State
:
asn1SccSystem_State
)
is
<>;
with
function
Full_State_Init
return
State_With_Observers
is
<>;
with
function
State_As_String
(
Full_State
:
State_With_Observers
)
return
String
is
<>;
Run_Observers
:
access
procedure
(
Full_State
:
in
out
State_With_Observers
;
Event
:
access
asn1sccObservable_Event
;
Id
:
out
Natural
;
...
...
@@ -48,6 +49,7 @@ private
(
Context_Ty
=>
State_With_Observers
,
Process_Ctxt
=>
Full_State
'Access,
Event_Ty => asn1SccObservable_Event,
State_As_String => State_As_String,
Print_Event => Print_Event);
end Simulator_Interface;
templates/concurrency_view/simulation_gpr/partition.tmplt
View file @
d0acf212
...
...
@@ -20,6 +20,7 @@ library project @_CAPITALIZE:Name_@_Simulator is
"simulator_interface.ads"
,
"taste_basictypes.ads"
,
"adaasn1rtl-encoding.ads"
,
"asn1_gser.ads"
,
@
_Threads
'Indent_@
"adaasn1rtl.ads");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment