Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
f2569144
Commit
f2569144
authored
Dec 01, 2010
by
François Bobot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Term : fold on type and applications
parent
dd7215a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
src/core/term.ml
src/core/term.ml
+30
-0
src/core/term.mli
src/core/term.mli
+6
-0
No files found.
src/core/term.ml
View file @
f2569144
...
...
@@ -1896,3 +1896,33 @@ let f_map_simp fnT fnF f = f_label_copy f (match f.f_node with
let
f_map_simp
fnT
=
f_map_simp
(
protect
fnT
)
(** Proposition of another fold *)
(* Type in terms and formulae *)
let
rec
t_fold_ty
fty
s
t
=
let
s
=
t_fold_unsafe
(
t_fold_ty
fty
)
(
f_fold_ty
fty
)
s
t
in
let
s
=
fty
s
t
.
t_ty
in
match
t
.
t_node
with
|
Teps
fb
->
let
vs
,_,_
=
fb
in
fty
s
vs
.
vs_ty
|
_
->
s
and
f_fold_ty
fty
s
f
=
let
s
=
f_fold_unsafe
(
t_fold_ty
fty
)
(
f_fold_ty
fty
)
s
f
in
match
f
.
f_node
with
|
Fquant
(
_
,
fq
)
->
let
(
vsl
,_,_,_
)
=
fq
in
List
.
fold_left
(
fun
s
vs
->
fty
s
vs
.
vs_ty
)
s
vsl
|
_
->
s
let
rec
t_fold_sig
fty
s
t
=
let
s
=
t_fold_unsafe
(
t_fold_sig
fty
)
(
f_fold_sig
fty
)
s
t
in
match
t
.
t_node
with
|
Tapp
(
fs
,
tl
)
->
fty
s
fs
(
List
.
map
(
fun
t
->
t
.
t_ty
)
tl
)
|
_
->
s
and
f_fold_sig
fty
s
f
=
let
s
=
f_fold_unsafe
(
t_fold_sig
fty
)
(
f_fold_sig
fty
)
s
f
in
match
f
.
f_node
with
|
Fapp
(
fs
,
tl
)
->
fty
s
fs
(
List
.
map
(
fun
t
->
t
.
t_ty
)
tl
)
|
_
->
s
src/core/term.mli
View file @
f2569144
...
...
@@ -506,3 +506,9 @@ exception NoMatch
val
t_match
:
term
Mvs
.
t
->
term
->
term
->
term
Mvs
.
t
val
f_match
:
term
Mvs
.
t
->
fmla
->
fmla
->
term
Mvs
.
t
(** Proposition of another fold *)
val
t_fold_ty
:
(
'
a
->
ty
->
'
a
)
->
'
a
->
term
->
'
a
val
f_fold_ty
:
(
'
a
->
ty
->
'
a
)
->
'
a
->
fmla
->
'
a
val
t_fold_sig
:
(
'
a
->
lsymbol
->
ty
list
->
'
a
)
->
'
a
->
term
->
'
a
val
f_fold_sig
:
(
'
a
->
lsymbol
->
ty
list
->
'
a
)
->
'
a
->
fmla
->
'
a
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment