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
09595eca
Commit
09595eca
authored
10 months ago
by
Kylian Fontaine
Browse files
Options
Downloads
Patches
Plain Diff
typo
parent
d6dcaf17
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
+5
-4
5 additions, 4 deletions
lib/gencoq.ml
lib/module.ml
+18
-11
18 additions, 11 deletions
lib/module.ml
with
23 additions
and
15 deletions
lib/gencoq.ml
+
5
−
4
View file @
09595eca
...
...
@@ -77,11 +77,12 @@ let multi (s:sensor list) : bool =
(** [expr_to_coq r] returns a Formula.t type expression (ast to write coq by PCourtieux) corresponding to the given expression r
@param expr DSL ast expression to convert to Formula.t
@return [Formula.t]*)
let
rec
expr_to_coq
(
r
:
expr
)
:
Formula
.
t
=
let
module
StringMap
=
Map
.
Make
(
String
)
in
match
r
with
|
Cst
c
->
Int
c
|
PatternMatching
(
e1
,
l
)
->
Match
((
expr_to_coq
e1
)
,
List
.
map
(
fun
x
->
match
x
with
|
e2
,
e3
->
(
expr_to_coq
e2
,
expr_to_coq
e3
))
l
)
...
...
@@ -106,10 +107,10 @@ let rec expr_to_coq (r : expr) : Formula.t =
|
Fun
(
s
,
e
)
->
Fun
(
Some
s
,
expr_to_coq
e
)
|
App
(
f
,
arg
)
->
App
(
expr_to_coq
f
,
[
expr_to_coq
arg
])
|
Set
s
->
Set
(
set_to_coq
s
)
|
Point
(
m
,
f
)
->
let
c
=
List
.
assoc
_opt
m
Module
.
correspondance
in
|
Point
(
m
,
f
)
->
let
c
=
StringMap
.
find
_opt
m
Module
.
correspondance
in
(
match
c
with
|
None
->
raise
(
Failure
(
"Problem: "
^
m
^
" unknow"
))
|
Some
x
->
(
match
List
.
assoc
_opt
f
x
with
|
Some
x
->
(
match
StringMap
.
find
_opt
f
x
with
|
None
->
raise
(
Failure
(
"Problem "
^
m
^
"."
^
f
^
" unknow"
))
|
Some
x'
->
x'
)
)
...
...
@@ -197,7 +198,7 @@ let instance_rigidity (r:rigidity) (valret : string list) (world: information li
|
[]
->
raise
(
Failure
" Error return value"
)
in
match
r
with
(*TODO: Est-ce la bonne maniere d'ecrire l'UpdateFunc?*)
|
Rigide
->
print_endline
(
rc_setoid
);
Instance
(
"RC"
,
Raw
(
"robot_choice "
^
rc_return
)
,
Raw
(
"{ robot_choice_Setoid := "
^
rc_setoid
^
"}"
))
|
Rigide
->
Instance
(
"RC"
,
Raw
(
"robot_choice "
^
rc_return
)
,
Raw
(
"{ robot_choice_Setoid := "
^
rc_setoid
^
"}"
))
::
Instance
(
"UC"
,
App
(
Var
(
0
,
"update_choice"
)
,
[
Cst
(
"unit"
)])
,
Raw
(
"NoChoice"
))
::
instance_updfunc_rigid
(
rc_return
)
world
...
...
This diff is collapsed.
Click to expand it.
lib/module.ml
+
18
−
11
View file @
09595eca
module
StringMap
=
Map
.
Make
(
String
)
let
geometry
=
StringMap
.
empty
|>
StringMap
.
add
"isobarycenter"
(
Formula
.
Raw
"isobarycenter"
)
|>
StringMap
.
add
"barycenter"
(
Formula
.
Raw
"barycenter"
)
|>
StringMap
.
add
"on_SEC"
(
Formula
.
Raw
"on_SEC"
)
let
geometry
=
[(
"isobarycenter"
,
Formula
.
Raw
(
"isobarycenter"
));
(
"barycenter"
,
Formula
.
Raw
(
"barycenter"
));
(
"on_SEC"
)
,
Formula
.
Raw
(
"on_SEC"
)]
let
observation
=
[(
"elements"
,
Formula
.
Raw
(
"(elements s)"
));
(
"support"
)
,
Formula
.
Raw
(
"support s"
)]
let
direction
=
[(
"forward"
,
Formula
.
Raw
(
"Forward"
));
(
"backward"
,
Formula
.
Raw
(
"Backward"
));
(
"selfloop"
,
Formula
.
Raw
(
"Selfloop"
));]
let
correspondance
=
[(
"Geometry"
,
geometry
);
(
"Obs"
,
observation
);
(
"Directions"
,
direction
)]
\ No newline at end of file
let
observation
=
StringMap
.
empty
|>
StringMap
.
add
"elements"
(
Formula
.
Raw
"(elements s)"
)
|>
StringMap
.
add
"support"
(
Formula
.
Raw
"support s"
)
let
direction
=
StringMap
.
empty
|>
StringMap
.
add
"forward"
(
Formula
.
Raw
"Forward"
)
|>
StringMap
.
add
"backward"
(
Formula
.
Raw
"Backward"
)
|>
StringMap
.
add
"selfloop"
(
Formula
.
Raw
"Selfloop"
)
let
correspondance
=
StringMap
.
empty
|>
StringMap
.
add
"Geometry"
geometry
|>
StringMap
.
add
"Obs"
observation
|>
StringMap
.
add
"Directions"
direction
\ No newline at end of file
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