Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
f9b8cc4e
Commit
f9b8cc4e
authored
2 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[wp/api] sequent printer request
parent
309615cb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/wp/ProofEngine.ml
+1
-0
1 addition, 0 deletions
src/plugins/wp/ProofEngine.ml
src/plugins/wp/wpApi.mli
+3
-0
3 additions, 0 deletions
src/plugins/wp/wpApi.mli
src/plugins/wp/wpTipApi.ml
+47
-5
47 additions, 5 deletions
src/plugins/wp/wpTipApi.ml
with
51 additions
and
5 deletions
src/plugins/wp/ProofEngine.ml
+
1
−
0
View file @
f9b8cc4e
...
@@ -198,6 +198,7 @@ let head t = match t.head with
...
@@ -198,6 +198,7 @@ let head t = match t.head with
|
Some
n
->
n
.
goal
|
Some
n
->
n
.
goal
let
tree
n
=
proof
~
main
:
n
.
tree
let
tree
n
=
proof
~
main
:
n
.
tree
let
goal
n
=
n
.
goal
let
goal
n
=
n
.
goal
let
stats
n
=
n
.
stats
let
stats
n
=
n
.
stats
let
tree_context
t
=
Wpo
.
get_context
t
.
main
let
tree_context
t
=
Wpo
.
get_context
t
.
main
let
node_context
n
=
Wpo
.
get_context
n
.
goal
let
node_context
n
=
Wpo
.
get_context
n
.
goal
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/wpApi.mli
+
3
−
0
View file @
f9b8cc4e
...
@@ -26,4 +26,7 @@
...
@@ -26,4 +26,7 @@
val
package
:
Server
.
Package
.
package
val
package
:
Server
.
Package
.
package
module
Goal
:
Server
.
Data
.
S
with
type
t
=
Wpo
.
t
module
Node
:
Server
.
Data
.
S
with
type
t
=
ProofEngine
.
node
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
This diff is collapsed.
Click to expand it.
src/plugins/wp/wpTipApi.ml
+
47
−
5
View file @
f9b8cc4e
...
@@ -31,7 +31,6 @@ module S = Server.States
...
@@ -31,7 +31,6 @@ module S = Server.States
module
Md
=
Markdown
module
Md
=
Markdown
module
AST
=
Server
.
Kernel_ast
module
AST
=
Server
.
Kernel_ast
let
()
=
ignore
WpApi
.
package
let
package
=
P
.
package
~
plugin
:
"wp"
~
name
:
"tip"
let
package
=
P
.
package
~
plugin
:
"wp"
~
name
:
"tip"
~
title
:
"WP Interactive Prover"
()
~
title
:
"WP Interactive Prover"
()
...
@@ -120,16 +119,59 @@ let () = Wpo.add_cleared_hook
...
@@ -120,16 +119,59 @@ let () = Wpo.add_cleared_hook
let
registry
=
PRINTER
.
get
()
in
let
registry
=
PRINTER
.
get
()
in
Hashtbl
.
clear
registry
)
Hashtbl
.
clear
registry
)
let
printer
(
node
:
ProofEngine
.
node
)
:
printer
=
let
printer
(
wpo
:
Wpo
.
t
)
:
printer
=
let
registry
=
PRINTER
.
get
()
in
let
registry
=
PRINTER
.
get
()
in
let
wpo
=
ProofEngine
.
goal
node
in
try
Hashtbl
.
find
registry
wpo
.
po_gid
with
Not_found
->
try
Hashtbl
.
find
registry
wpo
.
po_gid
with
Not_found
->
let
pp
=
new
printer
()
in
let
pp
=
new
printer
()
in
Hashtbl
.
add
registry
wpo
.
po_gid
pp
;
pp
Hashtbl
.
add
registry
wpo
.
po_gid
pp
;
pp
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(* --- Printer Requests --- *)
(* -------------------------------------------------------------------------- *)
let
()
=
(*TODO*)
ignore
package
let
signal
=
R
.
signal
~
package
~
name
:
"sequent"
~
descr
:
(
Md
.
plain
"Updated TIP"
)
let
()
=
(*TODO*)
ignore
printer
let
flags
(
type
a
)
tags
:
a
R
.
input
=
(
module
struct
type
t
=
a
let
jtype
=
P
.
Junion
(
List
.
map
(
fun
(
tg
,_
)
->
P
.
Jtag
tg
)
tags
)
let
of_json
js
=
List
.
assoc
(
Json
.
string
js
)
tags
end
)
let
iformat
:
Plang
.
iformat
R
.
input
=
flags
[
"dec"
,
`Dec
;
"hex"
,
`Hex
;
"bin"
,
`Bin
]
let
rformat
:
Plang
.
rformat
R
.
input
=
flags
[
"ratio"
,
`Ratio
;
"float"
,
`Float
;
"double"
,
`Double
]
let
()
=
let
printSequent
=
R
.
signature
~
output
:
(
module
D
.
Jtext
)
()
in
let
get_node
=
R
.
param
printSequent
~
name
:
"node"
~
descr
:
(
Md
.
plain
"Proof Node"
)
(
module
WpApi
.
Node
)
in
let
get_indent
=
R
.
param_opt
printSequent
~
name
:
"indent"
~
descr
:
(
Md
.
plain
"Number of identation spaces"
)
(
module
D
.
Jint
)
in
let
get_margin
=
R
.
param_opt
printSequent
~
name
:
"margin"
~
descr
:
(
Md
.
plain
"Maximial text width"
)
(
module
D
.
Jint
)
in
let
get_iformat
=
R
.
param_opt
printSequent
~
name
:
"iformat"
~
descr
:
(
Md
.
plain
"Integer constants format"
)
iformat
in
let
get_rformat
=
R
.
param_opt
printSequent
~
name
:
"rformat"
~
descr
:
(
Md
.
plain
"Real constants format"
)
rformat
in
R
.
register_sig
~
package
~
kind
:
`EXEC
~
name
:
"printSequent"
~
descr
:
(
Md
.
plain
"Pretty-print the associated node in its current state"
)
~
signals
:
[
signal
]
printSequent
begin
fun
rq
()
->
let
node
=
get_node
rq
in
let
indent
=
get_indent
rq
in
let
margin
=
get_margin
rq
in
let
tree
=
ProofEngine
.
tree
node
in
let
main
=
ProofEngine
.
main
tree
in
let
goal
=
ProofEngine
.
goal
node
in
let
pp
=
printer
main
in
Option
.
iter
pp
#
set_iformat
(
get_iformat
rq
)
;
Option
.
iter
pp
#
set_rformat
(
get_rformat
rq
)
;
D
.
jpretty
?
indent
?
margin
pp
#
pp_goal
goal
end
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
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