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
80a07cc0
Commit
80a07cc0
authored
11 months ago
by
Kylian Fontaine
Browse files
Options
Downloads
Patches
Plain Diff
regroupement des check
parent
7252b872
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ast.ml
+23
-17
23 additions, 17 deletions
lib/ast.ml
lib/gencoq.ml
+10
-4
10 additions, 4 deletions
lib/gencoq.ml
with
33 additions
and
21 deletions
lib/ast.ml
+
23
−
17
View file @
80a07cc0
...
...
@@ -356,23 +356,6 @@ type measure = Measure of G.t
type
description
=
Description
of
(
information
list
)
*
(
expr
list
)
*
measure
(**[check_description d] verifies that the description [d] has the minimum information
expected for a description and for each type of information to be unique
(two definitions of space which one to choose?...)
@param [d] description to check
@return true if the description meets the criteria false otherwise
*)
let
check_description
(
d
:
description
)
:
bool
=
let
unique
f
d
=
List
.
length
(
List
.
filter
f
d
)
=
1
in
match
d
with
|
Description
(
d'
,_,_
)
->
if
not
(
unique
info_sync
d'
)
then
(
print_endline
"Error: Problem of defining sync"
;
false
)
else
(
if
not
(
unique
info_space
d'
)
then
(
print_endline
"Error: Problem of defining space"
;
false
)
else
true
)
;;
(**[get_sensors d] Returns the list of sensors contained in description [d]
@param description
...
...
@@ -450,3 +433,26 @@ let check_light d : bool =
check
(
get_robot
d
)
(**[check_description d] verifies that the description [d] has the minimum information
expected for a description and for each type of information to be unique
(two definitions of space which one to choose?...)
@param [d] description to check
@return true if the description meets the criteria false otherwise
*)
let
check_description
(
d
:
description
)
:
bool
=
let
unique
f
d
=
List
.
length
(
List
.
filter
f
d
)
=
1
in
let
aux
d
=
match
d
with
|
Description
(
d'
,_,_
)
->
if
not
(
unique
info_sync
d'
)
then
raise
(
Failure
"Error: Problem of defining sync"
)
else
(
if
not
(
unique
info_space
d'
)
then
raise
(
Failure
"Error: Problem of defining space"
)
else
true
)
in
if
check_light
d
&&
check_activelyup
d
&&
check_sensors_desc
d
&&
aux
d
then
true
else
false
;;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/gencoq.ml
+
10
−
4
View file @
80a07cc0
...
...
@@ -348,6 +348,13 @@ match l with
|
h
::
tl
->
Or
(
Cst
(
h
)
,
generate_or
tl
)
|
_
->
Cst
(
""
)
(**[generate_definition_phase g] *)
let
generate_defintion_phase
(
g
:
G
.
t
)
:
stmt
list
=
Ast
.
G
.
fold_vertex
(
fun
v
acc
->
let
func_name
=
string_of_expression
v
^
" (config : configuration)"
in
RawCoq
([
"Definition "
^
func_name
^
":= (* To_Complete *)."
])
::
acc
)
g
[]
(**[generate_measure_per_phase g] returns the list of stmt generating the coq code of the measurement functions for each phase
@param g [G.t]
@return [stmt list]*)
...
...
@@ -396,7 +403,8 @@ let generate_measure (Measure(g): measure) (name_png : string) : stmt list =
Ast
.
png_from_graph
g
name_png
;
let
measure_per_phase
=
generate_measure_per_phase
g
in
let
lemsgen
=
let
lems
=
generate_lemmas
g
in
measure_per_phase
Comment
(
"Definition of phase"
)
::
generate_defintion_phase
g
@
Comment
(
"Definition of measure per phase "
)
::
measure_per_phase
@
Lemma
(
"InGraph"
,
Forall
(
"config"
,
generate_or
(
snd
lems
))
,
[
Comment
(
"TODO"
)])
::
List
.
rev
(
fst
lems
)
in
lemsgen
@
...
...
@@ -409,9 +417,7 @@ let generate_measure (Measure(g): measure) (name_png : string) : stmt list =
@param string s
@return[unit] *)
let
generate_coq
(
Description
(
d
,
r
,
m
)
:
description
)
(
section_name
:
string
)
=
if
Ast
.
check_light
(
Description
(
d
,
r
,
m
))
&&
Ast
.
check_activelyup
(
Description
(
d
,
r
,
m
))
&&
Ast
.
check_sensors_desc
(
Description
(
d
,
r
,
m
))
if
Ast
.
check_description
(
Description
(
d
,
r
,
m
))
then
let
file_out
=
open_out
(
"./generate/"
^
section_name
^
".v"
)
in
let
format_file
=
Format
.
formatter_of_out_channel
file_out
in
...
...
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