Commit 0bbd0c43 authored by Benoit Barbot's avatar Benoit Barbot
Browse files

improve modelconvert

parent b3a6ac10
Pipeline #1321 failed with stages
in 3 minutes and 8 seconds
......@@ -6,7 +6,7 @@ o : [0..2] init 0;
x : clock;
y : clock;
invariant
((o=0) | (o=1)) => (x<5)&(y<3)
(x<5)&(y<3)
endinvariant
[a] (o=0) & (y<=1) -> (y'=0);
......
......@@ -132,6 +132,9 @@ def WeightsPdfCdf(f): #Compute one iteration of operator Op with all weights/pdf
pdf=R(0);
pol=integral(pdf,t);
z=trans['zone'];
low = z[0]-clockO(x,i,z[1]);
#print("state:%i" %i);
#print(low);
cdf=pol - pol(t=z[0]-clockO(x,i,z[1]));
weight=pol(t=z[2]-clockO(x,i,z[3]))-pol(t=z[0]-clockO(x,i,z[1]));
psiDeltaf[i][j]=psiDeltaf[i][j]+(edge['prob'])*weight;
......
......@@ -142,6 +142,10 @@ module Guard = struct
| BoolName v -> [nb (v,SG,Int 0)]
| Not (BoolName v) -> [nb (v,EQ,Int 0)]
| Not e -> flatten (neg_bool e)
| FloatAtom (FloatName v, SL,j) -> [nb (v,SL,Ceil j)]
| FloatAtom (FloatName v, LE,j) -> [nb (v,LE,Ceil j)]
| FloatAtom (FloatName v,SG,j) -> [nb (v,SG,Floor j)]
| FloatAtom (FloatName v,GE,j) -> [nb (v,GE,Floor j)]
| e-> printH_expr stderr e;
failwith "Not yet supported guard shape"
......@@ -176,6 +180,7 @@ let print_prism_mod f m =
List.iter (function
| IntK(s,(l,m),init) ->
Printf.fprintf f "\t%s: [%a..%a] init %a;\n" s printH_expr l printH_expr m printH_expr init;
| ClockK (s)-> Printf.fprintf f "\t%s: clock;\n" s;
| _ -> failwith "unsupported"
) m.varlist;
......
......@@ -3,7 +3,7 @@
mkdir -p ../bin
rm -rf tmp
#ocamlbuild -use-ocamlfind -j 4 -pp "camlp4o pa_macro.cmo -DHAS_XML -DHAS_ZIP" -I ClessParser prism2SPT.native modelConvert.native parserUnparseAttribute.native
ocamlbuild -use-ocamlfind -j 4 -I ClessParser -I Prism -I Semantics prism2SPT.native StochasticPetriNet.cmo SemanticPT.cmo StochasticSymmetricNet.cmo modelConvert.native stochasticBound.native parserUnparseAttribute.native modelConvert.byte CosmosSimulink.native
ocamlbuild -use-ocamlfind -j 4 -I ClessParser -I Prism -I Semantics prism2SPT.native StochasticPetriNet.cmo SemanticPT.cmo StochasticSymmetricNet.cmo modelConvert.native stochasticBound.native parserUnparseAttribute.native modelConvert.byte CosmosSimulink.native prismTrans.cma prismTrans.cmxa
ocamlmktop -o petriscript -I _build str.cma type.cmo Prism/prismType.cmo Prism/parserPrism.cmo Prism/lexerPrism.cmo PetriNet.cmo StochPTPrinter.cmo Semantics/SemanticPT.cmo StochasticPetriNet.cmo StochasticSymmetricNet.cmo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment