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
e88ed827
Commit
e88ed827
authored
11 months ago
by
Kylian Fontaine
Browse files
Options
Downloads
Patches
Plain Diff
Correction require similarity
+ Ajout possibilité d'utiliser un Ring quelconque
parent
9959fae0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/gencoq.ml
+13
-7
13 additions, 7 deletions
lib/gencoq.ml
lib/parser.mly
+1
-0
1 addition, 0 deletions
lib/parser.mly
with
14 additions
and
7 deletions
lib/gencoq.ml
+
13
−
7
View file @
e88ed827
...
@@ -16,7 +16,7 @@ let correspondance = [("Geometry",geometry);
...
@@ -16,7 +16,7 @@ let correspondance = [("Geometry",geometry);
(
"Obs"
,
observation
);
(
"Obs"
,
observation
);
(
"Directions"
,
direction
)]
(
"Directions"
,
direction
)]
let
newline
=
RawCoq
([
" "
])
let
newline
=
RawCoq
([
" "
])
let
proof_to_complete
=
[
Comment
(
"Pr
euve
"
);
RawCoq
([
"Admitted."
])]
let
proof_to_complete
=
[
Comment
(
"Pr
oof
"
);
RawCoq
([
"Admitted."
])]
(** [get_nb_byz infos] retourne le nombre de byzantins désirés
(** [get_nb_byz infos] retourne le nombre de byzantins désirés
@param information list correspondant à la description du monde
@param information list correspondant à la description du monde
...
@@ -152,11 +152,13 @@ let instance_R_R2 (s:space) (d: information list): stmt list =
...
@@ -152,11 +152,13 @@ let instance_R_R2 (s:space) (d: information list): stmt list =
(**[instance_Ring n] genere le code coq pour instancier un Ring
(**[instance_Ring n] genere le code coq pour instancier un Ring
@param int n
@param int n
@return [stmt list]*)
@return [stmt list]*)
let
instance_Ring
(
n
:
int
)
:
stmt
list
=
let
instance_ring
(
n
:
int
)
:
stmt
list
=
if
n
>
0
then
Instance
(
"MyRing"
,
Raw
(
"RingSpec"
)
,
Record
([
Raw
(
"ring_size := "
^
string_of_int
n
);
Raw
(
"ring_size_spec:= (* QUOI METTRE ? *)"
)]))
Instance
(
"MyRing"
,
Raw
(
"RingSpec"
)
,
Record
([
Raw
(
"ring_size := "
^
string_of_int
n
);
Raw
(
"ring_size_spec:= (* QUOI METTRE ? *)"
)]))
::
Notation
(
"ring_node"
,
App
(
Cst
"finite_node"
,
[
Cst
"ring_size"
]
))
::
Notation
(
"ring_node"
,
App
(
Cst
"finite_node"
,
[
Cst
"ring_size"
]
))
::
Instance
(
"Loc"
,
Cst
"Location"
,
App
(
Cst
"make_Location"
,
[
Cst
"ring_node"
]))
::
[]
::
Instance
(
"Loc"
,
Cst
"Location"
,
App
(
Cst
"make_Location"
,
[
Cst
"ring_node"
]))
::
[]
else
RawCoq
([
"Context {RR : RingSpec}."
])
::
[]
(**[instance_space s] retourne une liste de stmt permettant de generer le code coq pour instancier l'espace s
(**[instance_space s] retourne une liste de stmt permettant de generer le code coq pour instancier l'espace s
@param space [s] à instancier pour le moment seulement R, R2, Ring
@param space [s] à instancier pour le moment seulement R, R2, Ring
...
@@ -167,12 +169,16 @@ let instance_space (s: space) (d : information list): stmt list =
...
@@ -167,12 +169,16 @@ let instance_space (s: space) (d : information list): stmt list =
match
s
with
match
s
with
|
R
->
instance_R_R2
s
d
|
R
->
instance_R_R2
s
d
|
R2
->
instance_R_R2
s
d
|
R2
->
instance_R_R2
s
d
|
ZnZ
n
->
instance_
R
ing
n
|
ZnZ
n
->
instance_
r
ing
n
|
_
->
raise
(
Failure
(
"Not implemanted"
))
|
_
->
raise
(
Failure
(
"Not implemanted"
))
in
in
s'
@
[]
s'
@
[]
let
instance_updfunc_Rigide
(
valret
:
string
)
:
stmt
=
(**[instane_updfunc_rigid valret] retourne le code coq pour instancier la fonction d'update
@param string valeur de retour du robogram
@return stmt
*)
let
instance_updfunc_rigid
(
valret
:
string
)
:
stmt
=
Instance
(
"UpdateFunc"
,
Raw
(
"update_function ("
^
valret
^
") (Similarity.similarity "
^
valret
^
") unit"
)
,
Raw
(
"{update := fun _ _ _ target _ => target;update_compat := ltac:(now repeat intro) }"
))
Instance
(
"UpdateFunc"
,
Raw
(
"update_function ("
^
valret
^
") (Similarity.similarity "
^
valret
^
") unit"
)
,
Raw
(
"{update := fun _ _ _ target _ => target;update_compat := ltac:(now repeat intro) }"
))
let
instance_updfunc_Flexible
(
d
:
expr
)
(
valret
:
string
)
:
stmt
=
let
instance_updfunc_Flexible
(
d
:
expr
)
(
valret
:
string
)
:
stmt
=
...
@@ -188,7 +194,7 @@ let instance_rigidity (r:rigidity) (valret : string) : stmt list =
...
@@ -188,7 +194,7 @@ let instance_rigidity (r:rigidity) (valret : string) : stmt list =
match
r
with
(*TODO: Est-ce la bonne maniere d'ecrire l'UpdateFunc?*)
match
r
with
(*TODO: Est-ce la bonne maniere d'ecrire l'UpdateFunc?*)
|
Rigide
->
Instance
(
"RobotChoice"
,
Raw
(
"robot_choice "
^
valret
)
,
Raw
(
"{ robot_choice_Setoid := "
^
valret
^
"_Setoid}"
))
|
Rigide
->
Instance
(
"RobotChoice"
,
Raw
(
"robot_choice "
^
valret
)
,
Raw
(
"{ robot_choice_Setoid := "
^
valret
^
"_Setoid}"
))
::
Instance
(
"ActiveChoice"
,
App
(
Var
(
0
,
"update_choice"
)
,
[
Var
(
0
,
"unit"
)])
,
Raw
(
"NoChoice"
))
::
Instance
(
"ActiveChoice"
,
App
(
Var
(
0
,
"update_choice"
)
,
[
Var
(
0
,
"unit"
)])
,
Raw
(
"NoChoice"
))
::
instance_updfunc_
R
igid
e
valret
::
instance_updfunc_
r
igid
valret
::
RawCoq
([
"Instance Rigid : RigidSetting."
;
"Proof using . split. reflexivity. Qed."
])
::
RawCoq
([
"Instance Rigid : RigidSetting."
;
"Proof using . split. reflexivity. Qed."
])
::
[]
::
[]
|
Flexible
d
->
Instance
(
"RobotChoice"
,
Raw
(
"robot_choice (path "
^
valret
^
")"
)
,
Raw
(
"{ robot_choice_Setoid := path_Setoid "
^
valret
^
"}"
))
|
Flexible
d
->
Instance
(
"RobotChoice"
,
Raw
(
"robot_choice (path "
^
valret
^
")"
)
,
Raw
(
"{ robot_choice_Setoid := path_Setoid "
^
valret
^
"}"
))
...
@@ -258,7 +264,7 @@ let instance_sensors (s:sensor list) : stmt list =
...
@@ -258,7 +264,7 @@ let instance_sensors (s:sensor list) : stmt list =
let
require_rigidity
(
r
:
rigidity
)
:
stmt
=
let
require_rigidity
(
r
:
rigidity
)
:
stmt
=
match
r
with
match
r
with
|
Flexible
_
->
Require
(
true
,
[
"Pactole.Models.Flexible"
])
|
Flexible
_
->
Require
(
true
,
[
"Pactole.Models.Flexible"
])
|
Rigide
->
Require
(
true
,
[
"Pactole.Models.Rigid"
])
|
Rigide
->
Require
(
true
,
[
"Pactole.Models.Rigid"
;
"Pactole.Models.Similarity"
])
(**[require_space s] retourne un stmt permettant de generer le require pour l'espace [s]
(**[require_space s] retourne un stmt permettant de generer le require pour l'espace [s]
...
...
This diff is collapsed.
Click to expand it.
lib/parser.mly
+
1
−
0
View file @
e88ed827
...
@@ -126,6 +126,7 @@ ints :
...
@@ -126,6 +126,7 @@ ints :
|
R2M
{
R2m
}
|
R2M
{
R2m
}
/*
Anneau
ZnZ
avec
n
donn
é
e
*/
/*
Anneau
ZnZ
avec
n
donn
é
e
*/
|
ANNEAU
n
=
INT
{
ZnZ
(
n
)}
|
ANNEAU
n
=
INT
{
ZnZ
(
n
)}
|
ANNEAU
{
ZnZ
(
0
)}
/*
/*
%
inline
capacity
:
%
inline
capacity
:
/*
(
Lumiere
:
l
)
*/
/*
(
Lumiere
:
l
)
*/
...
...
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