Skip to content

Commit 817b7e6

Browse files
authored
Add some of the tests from metamath-test (#57)
- Does not include anything which took a long time to run - Does not include versions of set.mm and the like - we check those elsewhere - Emphasis is on failure tests
1 parent ec5413a commit 817b7e6

31 files changed

+985
-0
lines changed

tests/anatomy-bad1.expected

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MM> READ "anatomy-bad1.mm"
2+
Reading source file "anatomy-bad1.mm"... 699 bytes
3+
699 bytes were read into the source buffer.
4+
The source has 8 statements; 1 are $a and 1 are $p.
5+
No errors were found. However, proofs were not checked. Type VERIFY PROOF *
6+
if you want to check them.
7+
MM> 0 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
8+
..................................................
9+
?Error on line 29 of file "anatomy-bad1.mm" at statement 8, label "wnew", type
10+
"$p":
11+
wnew $p wff ( s -> ( r -> p ) ) $= ws wr wp w2 ws $.
12+
^^
13+
After proof step 5 (the last step), the RPN stack contains 3 entries: "ws"
14+
(step 1), "w2" (step 4), and "ws" (step 5). It should contain exactly one
15+
entry.
16+

tests/anatomy-bad1.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
verify proof *

tests/anatomy-bad1.mm

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$( anatomy.mm $)
2+
3+
$(
4+
PUBLIC DOMAIN DEDICATION
5+
6+
This file is placed in the public domain per the Creative Commons Public
7+
Domain Dedication. http://creativecommons.org/licenses/publicdomain/
8+
9+
Norman Megill - email: nm at alum.mit.edu
10+
11+
$)
12+
13+
14+
$( This file is the introductory formal system example described
15+
in Chapter 4 of the Metamath book, "Anatomy of a proof". $)
16+
17+
$( Declare the constant symbols we will use $)
18+
$c ( ) -> wff $.
19+
$( Declare the metavariables we will use $)
20+
$v p q r s $.
21+
$( Declare wffs $)
22+
wp $f wff p $.
23+
wq $f wff q $.
24+
wr $f wff r $.
25+
ws $f wff s $.
26+
w2 $a wff ( p -> q ) $.
27+
28+
$( Prove a simple theorem. $)
29+
wnew $p wff ( s -> ( r -> p ) ) $= ws wr wp w2 ws $.
30+

tests/anatomy-bad2.expected

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
MM> READ "anatomy-bad2.mm"
2+
Reading source file "anatomy-bad2.mm"... 696 bytes
3+
696 bytes were read into the source buffer.
4+
The source has 8 statements; 1 are $a and 1 are $p.
5+
No errors were found. However, proofs were not checked. Type VERIFY PROOF *
6+
if you want to check them.
7+
MM> 0 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
8+
..................................................
9+
?Error on line 29 of file "anatomy-bad2.mm" at statement 8, label "wnew", type
10+
"$p":
11+
wnew $p wff ( s -> ( r -> p ) ) $= ws wr wp w2 $.
12+
^^
13+
After proof step 4 (the last step), the RPN stack contains 2 entries: "ws"
14+
(step 1) and "w2" (step 4). It should contain exactly one entry.
15+

tests/anatomy-bad2.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
verify proof *

tests/anatomy-bad2.mm

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$( anatomy.mm $)
2+
3+
$(
4+
PUBLIC DOMAIN DEDICATION
5+
6+
This file is placed in the public domain per the Creative Commons Public
7+
Domain Dedication. http://creativecommons.org/licenses/publicdomain/
8+
9+
Norman Megill - email: nm at alum.mit.edu
10+
11+
$)
12+
13+
14+
$( This file is the introductory formal system example described
15+
in Chapter 4 of the Metamath book, "Anatomy of a proof". $)
16+
17+
$( Declare the constant symbols we will use $)
18+
$c ( ) -> wff $.
19+
$( Declare the metavariables we will use $)
20+
$v p q r s $.
21+
$( Declare wffs $)
22+
wp $f wff p $.
23+
wq $f wff q $.
24+
wr $f wff r $.
25+
ws $f wff s $.
26+
w2 $a wff ( p -> q ) $.
27+
28+
$( Prove a simple theorem. $)
29+
wnew $p wff ( s -> ( r -> p ) ) $= ws wr wp w2 $.
30+

tests/anatomy-bad3.expected

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
MM> READ "anatomy-bad3.mm"
2+
Reading source file "anatomy-bad3.mm"... 696 bytes
3+
696 bytes were read into the source buffer.
4+
The source has 8 statements; 1 are $a and 1 are $p.
5+
No errors were found. However, proofs were not checked. Type VERIFY PROOF *
6+
if you want to check them.
7+
MM> 0 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
8+
..................................................
9+
?Error on line 29 of file "anatomy-bad3.mm" at statement 8, label "wnew", type
10+
"$p":
11+
wnew $p wff ( s -> ( r -> p ) ) $= wr wp w2 w2 $.
12+
^^
13+
At proof step 4, statement "w2" requires 2 hypotheses but the RPN stack
14+
contains only one entry, "w2" (step 3).
15+

tests/anatomy-bad3.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
verify proof *

tests/anatomy-bad3.mm

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$( anatomy.mm $)
2+
3+
$(
4+
PUBLIC DOMAIN DEDICATION
5+
6+
This file is placed in the public domain per the Creative Commons Public
7+
Domain Dedication. http://creativecommons.org/licenses/publicdomain/
8+
9+
Norman Megill - email: nm at alum.mit.edu
10+
11+
$)
12+
13+
14+
$( This file is the introductory formal system example described
15+
in Chapter 4 of the Metamath book, "Anatomy of a proof". $)
16+
17+
$( Declare the constant symbols we will use $)
18+
$c ( ) -> wff $.
19+
$( Declare the metavariables we will use $)
20+
$v p q r s $.
21+
$( Declare wffs $)
22+
wp $f wff p $.
23+
wq $f wff q $.
24+
wr $f wff r $.
25+
ws $f wff s $.
26+
w2 $a wff ( p -> q ) $.
27+
28+
$( Prove a simple theorem. $)
29+
wnew $p wff ( s -> ( r -> p ) ) $= wr wp w2 w2 $.
30+

tests/anatomy.expected

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MM> READ "anatomy.mm"
2+
Reading source file "anatomy.mm"... 699 bytes
3+
699 bytes were read into the source buffer.
4+
The source has 8 statements; 1 are $a and 1 are $p.
5+
No errors were found. However, proofs were not checked. Type VERIFY PROOF *
6+
if you want to check them.
7+
MM> 0 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
8+
..................................................
9+
All proofs in the database were verified.

0 commit comments

Comments
 (0)