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
8719b867
Commit
8719b867
authored
11 months ago
by
Kylian Fontaine
Browse files
Options
Downloads
Patches
Plain Diff
prettyprint sur les lemmes
parent
e5269a7b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/gencoq.ml
+15
-7
15 additions, 7 deletions
lib/gencoq.ml
with
15 additions
and
7 deletions
lib/gencoq.ml
+
15
−
7
View file @
8719b867
...
...
@@ -351,21 +351,29 @@ let generate_robogram (r : expr list) (d: information list) : stmt list =
|
[]
->
Def
(
"Robogram_pgm (s : observation)"
,
Raw
(
valretcoq
)
,
Raw
(
"[]"
))
::
[]
(**[generate_or l] retourne la formule or a partir d'une liste de string
@param string list
@return [Formula.t]*)
let
rec
generate_or
l
=
match
l
with
|
h
::
[]
->
Formula
.
Cst
(
h
)
|
h
::
tl
->
Or
(
Cst
(
h
)
,
generate_or
tl
)
|
_
->
Cst
(
""
)
(**[generate_lemmas g] retourne la liste de stmt correspondant aux lemmes extrait du graph g
@param g [G.t]
@return [stmt list]*)
let
generate_lemmas
(
g
:
Ast
.
G
.
t
)
:
(
stmt
list
*
string
list
)
=
Ast
.
G
.
fold_vertex
(
fun
v
(
acc
,
s
)
->
let
string_v
=
string_of_expression
v
in
let
succs
=
Ast
.
G
.
succ
g
v
in
let
forall
v
=
String
.
concat
" "
(
List
.
map
string_of_expression
(
Ast
.
get_param
v
))
in
if
succs
<>
[]
then
let
string_succs
=
(
List
.
map
string_of_expression
succs
)
in
let
rcs
=
List
.
map
(
fun
x
->
x
^
" (round Robogram da config)"
)
string_succs
in
(
Lemma
(
"lem_"
^
string_of_expression
v
^
"_next_"
^
String
.
concat
"_or_"
string_succs
,
Forall
((
"config "
^
forall
v
)
,
Raw
(
string_of_expression
v
^
" config -> ("
^
String
.
concat
"
\\
/ "
rcs
^
")"
))
,
[]
)
::
acc
,
(
"("
^
string_of_expression
v
^
" config )"
)
::
s
)
let
rcs
=
List
.
map
(
fun
x
->
x
^
" (round Robogram da config)"
)
(
string_v
::
string_succs
)
in
(
Lemma
(
"lem_"
^
string_v
^
"_next_"
^
String
.
concat
"_or_"
string_succs
,
Forall
(
"config"
,
InfixOp
(
Raw
(
string_v
^
" config"
)
,
"->"
,
(
generate_or
rcs
)
))
,
[]
)
::
acc
,
(
"("
^
string_v
^
" config)"
)
::
s
)
else
(
acc
,
s
)
)
g
([]
,
[]
)
...
...
@@ -380,7 +388,7 @@ let generate_measure (Measure(i,g): measure) : stmt list =
let
to_change
=
String
.
concat
","
(
List
.
init
i
(
fun
_
->
"0%nat"
))
in
Ast
.
png_from_graph
g
;
let
lemsgen
=
let
lems
=
generate_lemmas
g
in
Lemma
(
"InGraph"
,
Forall
(
"config"
,
Raw
(
String
.
concat
"
\\
/ "
(
snd
lems
))
)
,
[]
)
Lemma
(
"InGraph"
,
Forall
(
"config"
,
generate_or
(
snd
lems
))
,
[]
)
::
List
.
rev
(
fst
lems
)
in
RawCoq
([
"Function measure (s : observation) : "
^
ret
^
" :=
("
^
to_change
^
")."
;
(*TODO: *)
...
...
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