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
126
Issues
126
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
8b4b445b
Commit
8b4b445b
authored
May 03, 2020
by
Guillaume Melquiond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support multiple formats in TryWhy3 (fix #460).
parent
e4489586
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
451 additions
and
357 deletions
+451
-357
Makefile.in
Makefile.in
+2
-1
src/trywhy3/trywhy3.html
src/trywhy3/trywhy3.html
+9
-0
src/trywhy3/trywhy3.ml
src/trywhy3/trywhy3.ml
+397
-320
src/trywhy3/why3_worker.ml
src/trywhy3/why3_worker.ml
+24
-21
src/trywhy3/worker_proto.ml
src/trywhy3/worker_proto.ml
+19
-15
No files found.
Makefile.in
View file @
8b4b445b
...
...
@@ -1779,7 +1779,8 @@ src/trywhy3/why3_worker.js: src/trywhy3/why3_worker.byte src/trywhy3/try_alt_erg
`
find stdlib
-name
"*.mlw"
-printf
" --file=%p:/%p"
`
\
+dynlink.js +toplevel.js
$<
src/trywhy3/why3_worker.byte
:
$(WHY3CMA) $(addprefix src/trywhy3/
,
bindings.cmo worker_proto.cmo why3_worker.cmo)
src/trywhy3/why3_worker.byte
:
$(WHY3CMA) lib/plugins/python.cmo lib/plugins/microc.cmo
\
$(addprefix src/trywhy3/
,
bindings.cmo worker_proto.cmo why3_worker.cmo)
$(JSOCAMLC)
$(BFLAGS)
-o
$@
$(BLINKFLAGS)
$^
src/trywhy3/alt_ergo_worker.js
:
src/trywhy3/alt_ergo_worker.byte
...
...
src/trywhy3/trywhy3.html
View file @
8b4b445b
...
...
@@ -51,6 +51,15 @@
<div
class=
"why3-separator"
style=
"width:2em;"
></div>
<div
class=
"why3-button-group"
>
<select
id=
"why3-select-format"
title=
"Choose an input format"
>
<option
disabled=
"disabled"
selected=
"selected"
>
</option>
</select>
</div>
<div
class=
"why3-separator"
style=
"width:2em;"
></div>
<div
class=
"why3-button-group"
>
<span
id=
"why3-example-label"
class=
"fas fa-spin fa-refresh why3-icon"
></span>
<select
id=
"why3-select-example"
...
...
src/trywhy3/trywhy3.ml
View file @
8b4b445b
This diff is collapsed.
Click to expand it.
src/trywhy3/why3_worker.ml
View file @
8b4b445b
...
...
@@ -346,13 +346,13 @@ let why3_execute modules =
let
()
=
Sys_js
.
create_file
~
name
:
temp_file_name
~
content
:
""
let
why3_run
f
lang
code
=
let
why3_run
f
format
lang
code
=
try
let
ch
=
open_out
temp_file_name
in
output_string
ch
code
;
close_out
ch
;
let
(
theories
,
_
)
=
Env
.
read_file
lang
env
temp_file_name
in
let
(
theories
,
_
)
=
Env
.
read_file
~
format
lang
env
temp_file_name
in
W
.
send
(
Warning
!
Task
.
warnings
);
f
theories
with
...
...
@@ -367,27 +367,30 @@ let why3_run f lang code =
"unexpected exception: %a (%s)"
Exn_printer
.
exn_printer
e
(
Printexc
.
to_string
e
)))
let
handle_message
=
function
|
Transform
(
`Split
,
id
)
->
why3_split
id
|
Transform
(
`Prove
(
steps
)
,
id
)
->
why3_prove
~
steps
id
|
Transform
(
`Clean
,
id
)
->
why3_clean
id
|
ProveAll
->
why3_prove_all
()
|
ParseBuffer
(
format
,
code
)
->
Task
.
clear_warnings
()
;
Task
.
clear_table
()
;
why3_run
why3_parse_theories
format
Env
.
base_language
code
|
ExecuteBuffer
(
format
,
code
)
->
Task
.
clear_warnings
()
;
Task
.
clear_table
()
;
why3_run
why3_execute
format
Pmodule
.
mlw_language
code
|
SetStatus
(
st
,
id
)
->
List
.
iter
W
.
send
(
Task
.
set_status
id
st
)
|
GetFormats
->
let
formats
=
Env
.
list_formats
Env
.
base_language
in
let
formats
=
List
.
map
(
fun
(
name
,
ext
,
_
)
->
(
name
,
ext
))
formats
in
W
.
send
(
Formats
formats
)
let
()
=
W
.
set_onmessage
(
fun
msg
->
let
()
=
match
msg
with
|
Transform
(
`Split
,
id
)
->
why3_split
id
|
Transform
(
`Prove
(
steps
)
,
id
)
->
why3_prove
~
steps
id
|
Transform
(
`Clean
,
id
)
->
why3_clean
id
|
ProveAll
->
why3_prove_all
()
|
ParseBuffer
code
->
Task
.
clear_warnings
()
;
Task
.
clear_table
()
;
why3_run
why3_parse_theories
Env
.
base_language
code
|
ExecuteBuffer
code
->
Task
.
clear_warnings
()
;
Task
.
clear_table
()
;
why3_run
why3_execute
Pmodule
.
mlw_language
code
|
SetStatus
(
st
,
id
)
->
List
.
iter
W
.
send
(
Task
.
set_status
id
st
)
in
W
.
send
Idle
W
.
set_onmessage
(
fun
msg
->
handle_message
msg
;
W
.
send
Idle
)
(*
Local Variables:
...
...
src/trywhy3/worker_proto.ml
View file @
8b4b445b
...
...
@@ -16,21 +16,25 @@ type loc = int * int * int * int
type
why3_loc
=
string
*
(
int
*
int
*
int
)
(* kind, line, column, length *)
type
status
=
[
`New
|
`Valid
|
`Unknown
]
type
why3_command
=
ParseBuffer
of
string
|
ExecuteBuffer
of
string
|
ProveAll
|
Transform
of
[
`Prove
of
int
|
`Split
|
`Clean
]
*
id
|
SetStatus
of
status
*
id
type
why3_output
=
Error
of
string
(* msg *)
|
ErrorLoc
of
(
loc
*
string
)
(* loc * msg *)
|
Theory
of
id
*
string
(* Theory (id, name) *)
|
Task
of
(
id
*
id
*
string
*
string
*
why3_loc
list
*
string
*
int
)
(* id, parent id, expl, code, location list, pretty, steps*)
|
Result
of
string
list
|
UpdateStatus
of
status
*
id
|
Warning
of
((
int
*
int
)
*
string
)
list
|
Idle
type
why3_command
=
|
ParseBuffer
of
string
*
string
|
ExecuteBuffer
of
string
*
string
|
ProveAll
|
Transform
of
[
`Prove
of
int
|
`Split
|
`Clean
]
*
id
|
SetStatus
of
status
*
id
|
GetFormats
type
why3_output
=
|
Error
of
string
(* msg *)
|
ErrorLoc
of
(
loc
*
string
)
(* loc * msg *)
|
Theory
of
id
*
string
(* Theory (id, name) *)
|
Task
of
(
id
*
id
*
string
*
string
*
why3_loc
list
*
string
*
int
)
(* id, parent id, expl, code, location list, pretty, steps*)
|
Result
of
string
list
|
UpdateStatus
of
status
*
id
|
Warning
of
((
int
*
int
)
*
string
)
list
|
Idle
|
Formats
of
(
string
*
string
list
)
list
type
prover_command
=
OptionSteps
of
int
|
Goal
of
id
*
string
*
int
type
prover_output
=
Valid
|
Unknown
of
string
|
Invalid
of
string
...
...
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