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
19b0f79b
Commit
19b0f79b
authored
Apr 10, 2017
by
Stefan Berghofer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for generic number literals to Isabelle printer
parent
929db309
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
88 deletions
+19
-88
drivers/isabelle-common.gen
drivers/isabelle-common.gen
+0
-1
lib/isabelle/Why3_BV.thy.2016
lib/isabelle/Why3_BV.thy.2016
+6
-42
lib/isabelle/Why3_BV.thy.2016-1
lib/isabelle/Why3_BV.thy.2016-1
+6
-42
src/printer/isabelle.ml
src/printer/isabelle.ml
+7
-3
No files found.
drivers/isabelle-common.gen
View file @
19b0f79b
...
@@ -6,7 +6,6 @@ valid "Finished Why3 theory"
...
@@ -6,7 +6,6 @@ valid "Finished Why3 theory"
fail "\\*\\*\\* \\(.*\\)$" "\\1"
fail "\\*\\*\\* \\(.*\\)$" "\\1"
time "why3cpulimit time : %s s"
time "why3cpulimit time : %s s"
transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_epsilon"
transformation "eliminate_if_fmla"
transformation "eliminate_if_fmla"
transformation "eliminate_let_fmla"
transformation "eliminate_let_fmla"
...
...
lib/isabelle/Why3_BV.thy.2016
View file @
19b0f79b
...
@@ -365,8 +365,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -365,8 +365,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -563,8 +561,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -563,8 +561,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -761,8 +757,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -761,8 +757,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -959,8 +953,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -959,8 +953,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -1039,27 +1031,14 @@ why3_vc eq_sub_bv_def
...
@@ -1039,27 +1031,14 @@ why3_vc eq_sub_bv_def
why3_end
why3_end
definition rliteral_8 :: "'a::len0 word" where
"rliteral_8 = 2 ^ 8 - 1"
definition rliteral_16 :: "'a::len0 word" where
"rliteral_16 = 2 ^ 16 - 1"
definition rliteral_32 :: "'a::len0 word" where
"rliteral_32 = 2 ^ 32 - 1"
why3_open "bv/BVConverter_32_64.xml"
why3_open "bv/BVConverter_32_64.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_32
why3_vc rliteral_axiom by (simp add: rliteral_32_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_32_def
)
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1071,13 +1050,10 @@ why3_open "bv/BVConverter_16_64.xml"
...
@@ -1071,13 +1050,10 @@ why3_open "bv/BVConverter_16_64.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_16
why3_vc rliteral_axiom by (simp add: rliteral_16_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_16_def
)
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1089,13 +1065,10 @@ why3_open "bv/BVConverter_8_64.xml"
...
@@ -1089,13 +1065,10 @@ why3_open "bv/BVConverter_8_64.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_8
why3_vc rliteral_axiom by (simp add: rliteral_8_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_8_def
)
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1107,13 +1080,10 @@ why3_open "bv/BVConverter_16_32.xml"
...
@@ -1107,13 +1080,10 @@ why3_open "bv/BVConverter_16_32.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_16
why3_vc rliteral_axiom by (simp add: rliteral_16_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_16_def
)
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1125,13 +1095,10 @@ why3_open "bv/BVConverter_8_32.xml"
...
@@ -1125,13 +1095,10 @@ why3_open "bv/BVConverter_8_32.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_8
why3_vc rliteral_axiom by (simp add: rliteral_8_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_8_def
)
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1143,13 +1110,10 @@ why3_open "bv/BVConverter_8_16.xml"
...
@@ -1143,13 +1110,10 @@ why3_open "bv/BVConverter_8_16.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_8
why3_vc rliteral_axiom by (simp add: rliteral_8_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV16.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_8_def
)
by (simp add: BV16.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
...
lib/isabelle/Why3_BV.thy.2016-1
View file @
19b0f79b
...
@@ -365,8 +365,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -365,8 +365,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -563,8 +561,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -563,8 +561,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -761,8 +757,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -761,8 +757,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -959,8 +953,6 @@ why3_vc Nth_bv_is_nth2
...
@@ -959,8 +953,6 @@ why3_vc Nth_bv_is_nth2
using assms
using assms
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
by (simp add: bv_nth_def unat_def to_uint_of_int uint_in_range_def)
why3_vc tqtaxiom using to_uint_bounds [of i] by auto
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_size_bv by (simp add: size_bv_def)
why3_vc to_uint_zeros by simp
why3_vc to_uint_zeros by simp
...
@@ -1039,27 +1031,14 @@ why3_vc eq_sub_bv_def
...
@@ -1039,27 +1031,14 @@ why3_vc eq_sub_bv_def
why3_end
why3_end
definition rliteral_8 :: "'a::len0 word" where
"rliteral_8 = 2 ^ 8 - 1"
definition rliteral_16 :: "'a::len0 word" where
"rliteral_16 = 2 ^ 16 - 1"
definition rliteral_32 :: "'a::len0 word" where
"rliteral_32 = 2 ^ 32 - 1"
why3_open "bv/BVConverter_32_64.xml"
why3_open "bv/BVConverter_32_64.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_32
why3_vc rliteral_axiom by (simp add: rliteral_32_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_32_def
)
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1071,13 +1050,10 @@ why3_open "bv/BVConverter_16_64.xml"
...
@@ -1071,13 +1050,10 @@ why3_open "bv/BVConverter_16_64.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_16
why3_vc rliteral_axiom by (simp add: rliteral_16_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_16_def
)
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1089,13 +1065,10 @@ why3_open "bv/BVConverter_8_64.xml"
...
@@ -1089,13 +1065,10 @@ why3_open "bv/BVConverter_8_64.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_8
why3_vc rliteral_axiom by (simp add: rliteral_8_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_8_def
)
by (simp add: BV64.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1107,13 +1080,10 @@ why3_open "bv/BVConverter_16_32.xml"
...
@@ -1107,13 +1080,10 @@ why3_open "bv/BVConverter_16_32.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_16
why3_vc rliteral_axiom by (simp add: rliteral_16_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_16_def
)
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1125,13 +1095,10 @@ why3_open "bv/BVConverter_8_32.xml"
...
@@ -1125,13 +1095,10 @@ why3_open "bv/BVConverter_8_32.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_8
why3_vc rliteral_axiom by (simp add: rliteral_8_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_8_def
)
by (simp add: BV32.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
@@ -1143,13 +1110,10 @@ why3_open "bv/BVConverter_8_16.xml"
...
@@ -1143,13 +1110,10 @@ why3_open "bv/BVConverter_8_16.xml"
constants
constants
toBig = ucast
toBig = ucast
toSmall = ucast
toSmall = ucast
rliteral = rliteral_8
why3_vc rliteral_axiom by (simp add: rliteral_8_def)
why3_vc toSmall_to_uint
why3_vc toSmall_to_uint
using assms
using assms
by (simp add: BV16.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial
rliteral_8_def
)
by (simp add: BV16.ule_def ucast_def uint_word_of_int mod_pos_pos_trivial)
why3_vc toBig_to_uint
why3_vc toBig_to_uint
by (simp add: uint_up_ucast is_up)
by (simp add: uint_up_ucast is_up)
...
...
src/printer/isabelle.ml
View file @
19b0f79b
...
@@ -200,8 +200,7 @@ let rec print_term info defs fmt t = match t.t_node with
...
@@ -200,8 +200,7 @@ let rec print_term info defs fmt t = match t.t_node with
let
number_format
=
{
let
number_format
=
{
Number
.
long_int_support
=
true
;
Number
.
long_int_support
=
true
;
Number
.
extra_leading_zeros_support
=
true
;
Number
.
extra_leading_zeros_support
=
true
;
Number
.
dec_int_support
=
Number
.
Number_custom
Number
.
dec_int_support
=
Number
.
Number_default
;
"<num val=
\"
%s
\"
><type name=
\"
Int.int
\"
/></num>"
;
Number
.
hex_int_support
=
Number
.
Number_unsupported
;
Number
.
hex_int_support
=
Number
.
Number_unsupported
;
Number
.
oct_int_support
=
Number
.
Number_unsupported
;
Number
.
oct_int_support
=
Number
.
Number_unsupported
;
Number
.
bin_int_support
=
Number
.
Number_unsupported
;
Number
.
bin_int_support
=
Number
.
Number_unsupported
;
...
@@ -223,7 +222,12 @@ let rec print_term info defs fmt t = match t.t_node with
...
@@ -223,7 +222,12 @@ let rec print_term info defs fmt t = match t.t_node with
</app>"
));
</app>"
));
Number
.
def_real_support
=
Number
.
Number_unsupported
;
Number
.
def_real_support
=
Number
.
Number_unsupported
;
}
in
}
in
Number
.
print
number_format
fmt
c
begin
match
c
with
|
Number
.
ConstInt
_
->
fprintf
fmt
"<num val=
\"
%a
\"
>%a</num>"
(
Number
.
print
number_format
)
c
(
print_ty
info
)
(
t_type
t
)
|
_
->
Number
.
print
number_format
fmt
c
end
|
Tif
(
f
,
t1
,
t2
)
->
|
Tif
(
f
,
t1
,
t2
)
->
print_app
print_const
(
print_term
info
defs
)
fmt
(
"HOL.If"
,
[
f
;
t1
;
t2
])
print_app
print_const
(
print_term
info
defs
)
fmt
(
"HOL.If"
,
[
f
;
t1
;
t2
])
|
Tlet
(
t1
,
tb
)
->
|
Tlet
(
t1
,
tb
)
->
...
...
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