Skip to content

Commit 78a75ef

Browse files
committed
merge master
2 parents dce8c1d + d7ca4e5 commit 78a75ef

10 files changed

Lines changed: 581 additions & 48 deletions

File tree

examples/symbolic_logic/gries_schneider/GS2.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
3030
*************************************************************************** *)
3131

32-
<< "GS0.m"
32+
<< "../../test_driver.m"
3333

3434
(* Chaper 2, Boolean Expressions, page 25
3535
@@ -517,4 +517,4 @@ target f(a). The number of different ways to assign ||B|| values to ||A||
517517
(* You do the exercises in Chapter 2. *)
518518

519519

520-
Exit[Min[totalWrong, 255]]
520+
Quit[Min[totalWrong, 255]]

examples/symbolic_logic/gries_schneider/GS3.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ transitivityLaw as rewrite rules (from the cheat sheet in GS1.m):
7070
7171
*************************************************************************** *)
7272

73-
<<"GS0.m"
73+
<<"../../test_driver.m"
7474

7575
(* Section 3.1, Preliminaries ********************************************** *)
7676
(* ___ ___ _ _
@@ -2074,4 +2074,4 @@ posterior replacements from premises and prior replacements ("prior" and
20742074

20752075
expect[ true, true ] // Print
20762076

2077-
Exit[Min[totalWrong, 255]]
2077+
Quit[Min[totalWrong, 255]]

examples/symbolic_logic/gries_schneider/GS0.m renamed to examples/test_driver.m

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
(* ****************************************************************************
22
3+
Test driver code for examples.
4+
35
by Brian Beckman. License the same as for mathics.
46
57
Oct 2020
68
7-
These examples are adapted from Gries & Schnedier, "A Logical Approach
8-
to Discrete Math." The bibtex entry for this book follows:
9-
10-
@Book{gries1993a,
11-
author = {Gries, David},
12-
title = {A Logical Approach to Discrete Math},
13-
publisher = {Springer New York},
14-
year = {1993},
15-
address = {New York, NY},
16-
isbn = {978-1-4757-3837-7}}
9+
This originally called GS0.m in symbolic_logic/gries_schneider
10+
but it is not application specific.
1711
1812
*************************************************************************** *)
1913

2014
(* ***************************************************************************
2115
2216
This file contains tooling so we can write 'expected' and 'actual' in our
2317
examples. You don't need to understand how this works. You just need to know
24-
how to use it, and you'll see how in the examples in GS1.m, GS2.m, GS3.m.
18+
how to use it, and you'll see how in the examples in GS1.m, GS2.m, GS3.m
19+
of symbolic_logic/gries_schneider.
2520
2621
*************************************************************************** *)
2722

mathics/builtin/scoping.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ class Context(Builtin):
412412
= Global`
413413
>> Context[b`c]
414414
= b`
415-
>> Context[Sin] // InputForm
416-
= "System`"
417415
418416
>> InputForm[Context[]]
419417
= "Global`"
@@ -461,8 +459,8 @@ class Contexts(Builtin):
461459
462460
## this assignment makes sure that a definition in Global` exists
463461
>> x = 5;
464-
>> Contexts[] // InputForm
465-
= {"Global`", "ImportExport`", "Internal`", "System`", "System`Convert`B64Dump`", "System`Convert`Image`", "System`Convert`JSONDump`", "System`Convert`TableDump`", "System`Convert`TextDump`", "System`Private`", "XML`", "XML`Parser`"}
462+
X> Contexts[] // InputForm
463+
466464
"""
467465

468466
def apply(self, evaluation):
@@ -513,12 +511,7 @@ class ContextPath(Predefined):
513511
<dd>is the search path for contexts.
514512
</dl>
515513
516-
>> $ContextPath // InputForm
517-
= {"Global`", "System`"}
518-
519-
#> $ContextPath = Sin[2]
520-
: Sin[2] is not a list of valid context names ending in `.
521-
= Sin[2]
514+
X> $ContextPath // InputForm
522515
523516
#> x`x = 1; x
524517
= x
@@ -550,8 +543,7 @@ class Begin(Builtin):
550543
551544
>> Begin["test`"]
552545
= test`
553-
>> {$Context, $ContextPath}
554-
= {test`, {Global`, System`}}
546+
X> {$Context, $ContextPath}
555547
>> Context[newsymbol]
556548
= test`
557549
>> End[]
@@ -617,19 +609,8 @@ class BeginPackage(Builtin):
617609
'BeginPackage' changes the values of '$Context' and
618610
'$ContextPath', setting the current context to $context$.
619611
620-
>> {$Context, $ContextPath}
621-
= {Global`, {Global`, System`}}
622612
>> BeginPackage["test`"]
623613
= test`
624-
>> {$Context, $ContextPath}
625-
= {test`, {test`, System`}}
626-
>> Context[newsymbol]
627-
= test`
628-
>> EndPackage[]
629-
>> {$Context, $ContextPath}
630-
= {Global`, {test`, Global`, System`}}
631-
>> EndPackage[]
632-
: No previous context defined.
633614
"""
634615

635616
messages = {

0 commit comments

Comments
 (0)