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
121
Issues
121
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
f960d2a8
Commit
f960d2a8
authored
Mar 15, 2013
by
Andrei Paskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coq: remove previously generated commented "intros"
parent
9d07d15b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
src/printer/coq.ml
src/printer/coq.ml
+16
-9
No files found.
src/printer/coq.ml
View file @
f960d2a8
...
...
@@ -428,9 +428,15 @@ let read_comment =
done
;
name
let
read_until
re
s
i
ch
=
if
not
(
Str
.
string_match
re
s
i
)
then
while
not
(
Str
.
string_match
re
(
input_line
ch
)
0
)
do
()
done
let
read_old_proof
=
let
def
=
Str
.
regexp
"
\\
(Definition
\\
|Notation
\\
|Lemma
\\
|Theorem
\\
|Variable
\\
|Hypothesis
\\
)[ ]+
\\
([^ :(.]+
\\
)"
in
let
def_end
=
Str
.
regexp
".*[.]$"
in
let
old_intros
=
Str
.
regexp
"^ *([*] Why3 intros "
in
let
old_end
=
Str
.
regexp
".*[*])"
in
let
qed
=
Str
.
regexp
"
\\
(Qed
\\
|Defined
\\
|Save
\\
|Admitted
\\
)[.]"
in
fun
ch
->
try
...
...
@@ -439,8 +445,7 @@ let read_old_proof =
if
not
(
Str
.
string_match
def
s
0
)
then
raise
(
StringValue
s
);
let
kind
=
Str
.
matched_group
1
s
in
let
name
=
Str
.
matched_group
2
s
in
if
not
(
Str
.
string_match
def_end
s
(
Str
.
match_end
()
))
then
while
not
(
Str
.
string_match
def_end
(
input_line
ch
)
0
)
do
()
done
;
read_until
def_end
s
(
Str
.
match_end
()
)
ch
;
match
kind
with
|
"Variable"
|
"Hypothesis"
->
Axiom
name
|
_
->
...
...
@@ -448,7 +453,13 @@ let read_old_proof =
if
kind
=
"Notation"
then
Notation
else
begin
start
:=
pos_in
ch
;
while
not
(
Str
.
string_match
qed
(
input_line
ch
)
0
)
do
()
done
;
let
s
=
input_line
ch
in
if
Str
.
string_match
old_intros
s
0
then
begin
read_until
old_end
s
(
Str
.
match_end
()
)
ch
;
start
:=
pos_in
ch
;
read_until
qed
(
input_line
ch
)
0
ch
end
else
read_until
qed
s
0
ch
;
Vernacular
end
in
let
len
=
pos_in
ch
-
!
start
in
...
...
@@ -620,18 +631,14 @@ let print_empty_proof fmt def =
fprintf
fmt
"@
\n
"
;
fprintf
fmt
"Defined.@
\n
"
let
old_intros
=
Str
.
regexp
"^ *([*] intros "
let
print_previous_proof
def
info
fmt
previous
=
match
previous
with
|
None
->
print_empty_proof
fmt
def
|
Some
(
Query
(
_
,
Vernacular
,
c
))
->
begin
match
def
with
|
Some
(
p
,
f
)
->
if
not
info
.
realization
&&
need_intros
p
f
&&
not
(
Str
.
string_match
old_intros
c
0
)
then
fprintf
fmt
"@[(* %a *)@]@
\n
"
(
fun
fmt
f
->
intros
fmt
p
f
)
f
|
Some
(
p
,
f
)
when
not
info
.
realization
&&
need_intros
p
f
->
fprintf
fmt
"@[(* Why3 %a *)@]@
\n
"
(
fun
fmt
f
->
intros
fmt
p
f
)
f
|
_
->
()
end
;
fprintf
fmt
"%s"
c
...
...
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