Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
why3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Why3
why3
Commits
463f7dd1
Commit
463f7dd1
authored
14 years ago
by
Johannes Kanig
Browse files
Options
Downloads
Patches
Plain Diff
decl: new function decl_map_fold
parent
0e46a271
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/decl.ml
+23
-0
23 additions, 0 deletions
src/core/decl.ml
src/core/decl.mli
+4
-0
4 additions, 0 deletions
src/core/decl.mli
with
27 additions
and
0 deletions
src/core/decl.ml
+
23
−
0
View file @
463f7dd1
...
...
@@ -357,6 +357,29 @@ let decl_fold fnT fnF acc d = match d.d_node with
|
Dprop
(
_
,_,
f
)
->
fnF
acc
f
let
rpair_map_fold
f
acc
(
x1
,
x2
)
=
let
acc
,
x2
=
f
acc
x2
in
acc
,
(
x1
,
x2
)
let
list_rpair_map_fold
f
=
Util
.
map_fold_left
(
rpair_map_fold
f
)
let
decl_map_fold
fnT
fnF
acc
d
=
match
d
.
d_node
with
|
Dtype
_
->
acc
,
d
|
Dprop
(
k
,
pr
,
f
)
->
let
acc
,
f
=
f_map_fold
fnT
fnF
acc
f
in
acc
,
create_prop_decl
k
pr
f
|
Dind
l
->
let
acc
,
l
=
list_rpair_map_fold
(
list_rpair_map_fold
(
f_map_fold
fnT
fnF
))
acc
l
in
acc
,
create_ind_decl
l
|
Dlogic
l
->
let
acc
,
l
=
list_rpair_map_fold
(
option_map_fold
(
rpair_map_fold
(
f_map_fold
fnT
fnF
)))
acc
l
in
acc
,
create_logic_decl
l
(** Known identifiers *)
...
...
This diff is collapsed.
Click to expand it.
src/core/decl.mli
+
4
−
0
View file @
463f7dd1
...
...
@@ -126,6 +126,10 @@ exception EmptyIndDecl of lsymbol
val
decl_map
:
(
term
->
term
)
->
(
fmla
->
fmla
)
->
decl
->
decl
val
decl_fold
:
(
'
a
->
term
->
'
a
)
->
(
'
a
->
fmla
->
'
a
)
->
'
a
->
decl
->
'
a
val
decl_map_fold
:
(
'
a
->
term
->
'
a
*
term
)
->
(
'
a
->
fmla
->
'
a
*
fmla
)
->
'
a
->
decl
->
'
a
*
decl
(** {2 Known identifiers} *)
type
known_map
=
decl
Mid
.
t
...
...
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