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
e4d9c086
Commit
e4d9c086
authored
Jul 26, 2016
by
François Bobot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a smart constructor for [update_session] conf
parent
b6bda82d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
21 deletions
+36
-21
examples/use_api/create_session.ml
examples/use_api/create_session.ml
+3
-7
src/session/session.ml
src/session/session.ml
+14
-0
src/session/session.mli
src/session/session.mli
+10
-0
src/session/session_scheduler.ml
src/session/session_scheduler.ml
+5
-7
src/why3session/why3session_lib.ml
src/why3session/why3session_lib.ml
+4
-7
No files found.
examples/use_api/create_session.ml
View file @
e4d9c086
...
...
@@ -59,13 +59,9 @@ let dummy_keygen ?parent () = ()
(* create an empty session in the current directory *)
let
env_session
,_,_
=
let
dummy_session
:
unit
Session
.
session
=
Session
.
create_session
"."
in
let
ctxt
=
{
Session
.
allow_obsolete_goals
=
true
;
Session
.
keep_unmatched_theories
=
false
;
Session
.
release_tasks
=
false
;
Session
.
use_shapes_for_pairing_sub_goals
=
false
;
Session
.
keygen
=
dummy_keygen
;
}
let
ctxt
=
Session
.
mk_update_context
~
allow_obsolete_goals
:
true
dummy_keygen
in
Session
.
update_session
~
ctxt
dummy_session
env
config
...
...
src/session/session.ml
View file @
e4d9c086
...
...
@@ -2294,6 +2294,20 @@ type 'key update_context =
keep_unmatched_theories
:
bool
;
}
let
mk_update_context
?
(
allow_obsolete_goals
=
false
)
?
(
release_tasks
=
false
)
?
(
use_shapes_for_pairing_sub_goals
=
false
)
?
(
keep_unmatched_theories
=
false
)
keygen
=
{
allow_obsolete_goals
;
release_tasks
;
use_shapes_for_pairing_sub_goals
;
keygen
;
keep_unmatched_theories
;
}
let
rec
recover_sub_tasks
~
theories
env_session
task
g
=
g
.
goal_task
<-
Some
task
;
(* Check that the sum and shape don't change (the order is kept)
...
...
src/session/session.mli
View file @
e4d9c086
...
...
@@ -248,6 +248,16 @@ type 'key update_context =
keep_unmatched_theories
:
bool
;
}
val
mk_update_context
:
?
allow_obsolete_goals
:
bool
->
?
release_tasks
:
bool
->
?
use_shapes_for_pairing_sub_goals
:
bool
->
?
keep_unmatched_theories
:
bool
->
'
key
keygen
->
'
key
update_context
(** By default all optional arguments are false. The meaning of the
arguments is described in {!Session.update_session} *)
val
update_session
:
ctxt
:
'
key
update_context
->
'
oldkey
session
->
...
...
src/session/session_scheduler.ml
View file @
e4d9c086
...
...
@@ -294,13 +294,11 @@ let init_session session = session_iter init_any session
let
update_session
~
allow_obsolete
~
release
~
use_shapes
old_session
env
whyconf
=
O
.
reset
()
;
let
ctxt
=
{
keep_unmatched_theories
=
false
;
allow_obsolete_goals
=
allow_obsolete
;
release_tasks
=
release
;
use_shapes_for_pairing_sub_goals
=
use_shapes
;
keygen
=
O
.
create
;
}
let
ctxt
=
Session
.
mk_update_context
~
allow_obsolete_goals
:
allow_obsolete
~
release_tasks
:
release
~
use_shapes_for_pairing_sub_goals
:
use_shapes
O
.
create
in
let
(
env_session
,_,_
)
as
res
=
update_session
~
ctxt
old_session
env
whyconf
...
...
src/why3session/why3session_lib.ml
View file @
e4d9c086
...
...
@@ -74,13 +74,10 @@ let read_env_spec () =
let
read_update_session
~
allow_obsolete
env
config
fname
=
let
project_dir
=
S
.
get_project_dir
fname
in
let
session
,
use_shapes
=
S
.
read_session
project_dir
in
let
ctxt
=
{
S
.
allow_obsolete_goals
=
allow_obsolete
;
S
.
keep_unmatched_theories
=
false
;
S
.
release_tasks
=
false
;
S
.
use_shapes_for_pairing_sub_goals
=
use_shapes
;
S
.
keygen
=
(
fun
?
parent
:_
()
->
()
);
}
let
ctxt
=
S
.
mk_update_context
~
allow_obsolete_goals
:
allow_obsolete
~
use_shapes_for_pairing_sub_goals
:
use_shapes
(
fun
?
parent
:_
()
->
()
)
in
S
.
update_session
~
ctxt
session
env
config
...
...
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