Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DSL pour Robotique en essaim
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kylian Fontaine
DSL pour Robotique en essaim
Commits
c17d1884
Commit
c17d1884
authored
10 months ago
by
Kylian Fontaine
Browse files
Options
Downloads
Patches
Plain Diff
graphe png genere dans meme fichier que les .v
parent
73e25248
No related branches found
No related tags found
1 merge request
!1
Module
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ast.ml
+6
-6
6 additions, 6 deletions
lib/ast.ml
lib/gencoq.ml
+5
-5
5 additions, 5 deletions
lib/gencoq.ml
with
11 additions
and
11 deletions
lib/ast.ml
+
6
−
6
View file @
c17d1884
...
...
@@ -329,7 +329,7 @@ let graph_from_edges (el : edge list)=
@param g [G.t]
@param name [string] png file name
@return[unit]*)
let
png_from_graph
g
name
=
let
png_from_graph
g
name
dir
=
let
graph
=
G
.
fold_vertex
(
fun
v
acc
->
let
succs
=
List
.
map
string_of_expression
(
G
.
succ
g
v
)
in
let
v'
=
string_of_expression
v
in
...
...
@@ -338,10 +338,10 @@ let png_from_graph g name=
acc
^
"
\"
"
^
v'
^
"
\"
;
\n
"
^
edges
)
g
""
in
let
dot
=
"digraph G {
\n
rankdir=LR;
\n
ranksep=1;
\n
"
^
graph
^
"
\n
splines=true;
\n
overlap=false; "
^
"}"
in
let
oc
=
open_out
(
"./generate
/"
^
name
^
"_measure.dot"
)
in
let
oc
=
open_out
(
dir
^
"
/"
^
name
^
"_measure.dot"
)
in
Printf
.
fprintf
oc
"%s
\n
"
dot
;
close_out
oc
;
ignore
(
Sys
.
command
(
"dot -Tpng ./generate/"
^
name
^
"_measure.dot -o
./generate
/"
^
name
^
"_measure.png"
))
ignore
(
Sys
.
command
(
"dot -Tpng ./generate/"
^
name
^
"_measure.dot -o
"
^
dir
^
"
/"
^
name
^
"_measure.png"
))
(**[assign_heigth g] returns the phase, phase weight association list. The phase weight is deduced from the order
topology of the phase
...
...
@@ -448,7 +448,7 @@ let string_of_expr_list expr_list =
(**[png_from_graph2 g ] renvoie l'image au format png du graphe [g]
@param g de type [G2.t] graphe de liste de liste d'expression, composants fortement connexe *)
let
png_from_graph2
(
g
:
G2
.
t
)
(
name
:
string
)
:
unit
=
let
png_from_graph2
(
g
:
G2
.
t
)
(
name
:
string
)
(
dir
:
string
)
:
unit
=
let
graph
=
G2
.
fold_vertex
(
fun
v
acc
->
let
succs
=
List
.
map
string_of_expr_list
(
G2
.
succ
g
v
)
in
let
v'
=
string_of_expr_list
v
in
...
...
@@ -457,10 +457,10 @@ let png_from_graph2 (g:G2.t) (name : string) :unit =
acc
^
"
\"
"
^
v'
^
"
\"
;
\n
"
^
edges
)
g
""
in
let
dot
=
"digraph G {
\n
rankdir=LR;
\n
ranksep=1;
\n
"
^
graph
^
"
\n
splines=true;
\n
overlap=false; "
^
"}"
in
let
oc
=
open_out
(
"./generate
/"
^
name
^
"_measure.dot"
)
in
let
oc
=
open_out
(
dir
^
"
/"
^
name
^
"_measure.dot"
)
in
Printf
.
fprintf
oc
"%s
\n
"
dot
;
close_out
oc
;
ignore
(
Sys
.
command
(
"dot -Tpng ./generate/"
^
name
^
"_measure.dot -o
./generate
/"
^
name
^
"_measure.png"
))
ignore
(
Sys
.
command
(
"dot -Tpng ./generate/"
^
name
^
"_measure.dot -o
"
^
dir
^
"
/"
^
name
^
"_measure.png"
))
(** [scc_graph g] retourne le graphe G2.t correspondant au graphe de composants fortement connexe du graphe [g]
...
...
This diff is collapsed.
Click to expand it.
lib/gencoq.ml
+
5
−
5
View file @
c17d1884
...
...
@@ -514,7 +514,7 @@ let write_coq_file (gen: stmt list) (filename : string) =
print_endline
(
filename
^
" has been generated"
);;
(*
(**[generate_coq d s] generates the coq file containing the world description module, the type module and the proof module
@param description of
@param string s
...
...
@@ -524,7 +524,7 @@ let generate_coq (Description(d,r,Measure g) : description) (name : string)=
then
let gmpptype, gmpp_proof = generate_measure_per_phase g in
let gdp_type, gdp_proof = generate_definition_phase g in
Ast
.
png_from_graph
g
name
;
Ast.png_from_graph g name
;
Ast.png_from_graph2 (Ast.scc_graph g;) (name^"_scc_graph");
let file_exists =
Sys.file_exists ("./generate/"^name^".v") in
...
...
@@ -540,7 +540,7 @@ let generate_coq (Description(d,r,Measure g) : description) (name : string)=
else
()
*)
(**[generate_filename base n dir]
@param base : string, base file name
@param n : integer, number of file iterations
...
...
@@ -566,8 +566,8 @@ let generate_coq_2files (Description(d,r,Measure g) : description) (name : strin
let
gdp_type
,
gdp_proof
=
generate_definition_phase
g
in
let
name_gen
=
if
overwrite
then
type_name
else
generate_filename
type_name
1
dir
in
if
gen_graph
then
begin
Ast
.
png_from_graph
g
name_gen
;
Ast
.
png_from_graph2
(
Ast
.
scc_graph
g
)
(
name_gen
^
"_scc_graph"
);
Ast
.
png_from_graph
g
name_gen
dir
;
Ast
.
png_from_graph2
(
Ast
.
scc_graph
g
)
(
name_gen
^
"_scc_graph"
)
dir
;
end
;
let
module_world_type
=
(
generate_requires
d
)
@
Module
(
"World"
,
(
generate_instances
d
)
@
newline
::
generate_robogram
r
d
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment