

1  loadMacros("MathObjects.pl"); 
1  
2  
2  =pod 
3  sub _contextInequalities_init {Inequalities::Init()} 
3  
4  


5  =head1 Context("Inequalities"), Context("InequalitiesOnly") 


6  
4  ######################################################################### 
7  ######################################################################### 
5  # 
8  # 
6  # Implements contexts that provides for inequalities that produce 
9  # Implements contexts that provides for inequalities that produce 
7  # the cooresponding Interval, Set or Union MathObjects. There are 
10  # the cooresponding Interval, Set or Union MathObjects. There are 
8  # two such contexts: Context("Inequalities"), in which both 
11  # two such contexts: Context("Inequalities"), in which both 
9  # intervals and inequalities are defined, and Context("InequalitiesOnly"), 
12  # intervals and inequalities are defined, and Context("InequalitiesOnly"), 
10  # which allows only inequalities as a means of producing intervals. 
13  # which allows only inequalities as a means of producing intervals. 
11  # 
14  # 
12  # Usage: loadMacros("contextInequalities.pl"); 
15  # Usage: loadMacros("contextInequalities.pl"); 
13  # 
16  # 
14  # Context("Inequalities"); 
17  # Context("Inequalities"); 
15  # $S1 = Formula("1 < x <= 4"); 
18  # $S1 = Formula("1 < x <= 4"); 
16  # $S2 = Formula("(1,4]"); # either form is OK 
19  # $S2 = Formula("(1,4]"); # either form is OK 
17  # 
20  # 
18  # Context("InequalitiesOnly"); 
21  # Context("InequalitiesOnly"); 
19  # $S1 = Formula("1 < x <= 4"); 
22  # $S1 = Formula("1 < x <= 4"); 
20  # $S2 = Formula("(1,4]"); # generates an error 
23  # $S2 = Formula("(1,4]"); # generates an error 
21  # 
24  # 
22  # $S3 = Formula("x < 2 or x > 2"); # forms a Union 
25  # $S3 = Formula("x < 2 or x > 2"); # forms a Union 
23  # $S4 = Formula("x = 1"); # forms a Set 
26  # $S4 = Formula("x = 1"); # forms a Set 
24  # 
27  # 
25  # You can set the "stringifyAsInequalities" flag to 1 to force 
28  # You can set the "stringifyAsInequalities" flag to 1 to force 
26  # output from the intervals, sets, and unions created in this 
29  # output from the intervals, sets, and unions created in this 
27  # context to be output as inequalities rather than their 
30  # context to be output as inequalities rather than their 
28  # usual Inerval, Set or Union forms. 
31  # usual Inerval, Set or Union forms. 
29  # 
32  # 
30  # Context("Inequalities")>flags>set(stringifyAsInequalities=>1); 
33  # Context("Inequalities")>flags>set(stringifyAsInequalities=>1); 
31  # 
34  # 
32  # You can also set the "noneWord" flag to specify the string to 
35  # You can also set the "noneWord" flag to specify the string to 
33  # use when the inequalities specify the empty set. By default, 
36  # use when the inequalities specify the empty set. By default, 
34  # it is "NONE", but you can change it to other strings. Be sure 
37  # it is "NONE", but you can change it to other strings. Be sure 
35  # that you use a string that is defined in the Context, however, 
38  # that you use a string that is defined in the Context, however, 
36  # if you expect the student to be able to enter it. For example 
39  # if you expect the student to be able to enter it. For example 
37  # 
40  # 
38  # Context("Inequalities"); 
41  # Context("Inequalities"); 
39  # Context()>constants>add(EmptySet => Set()); 
42  # Context()>constants>add(EmptySet => Set()); 
40  # Context()>flags>set(noneWord=>"EmptySet"); 
43  # Context()>flags>set(noneWord=>"EmptySet"); 
41  # 
44  # 
42  # creates an empty set as a named constant and uses that name. 
45  # creates an empty set as a named constant and uses that name. 
43  # 
46  # 
44  
47  
45  =cut 
48  =cut 
46  


47  loadMacros("MathObjects.pl"); 


48  


49  sub _contextInequalities_init {Inequalities::Init()} 


50  


51  ################################################## 


52  
49  
53  package Inequalities; 
50  package Inequalities; 
54  
51  
55  # 
52  # 
56  # Sets up the two inequality contexts 
53  # Sets up the two inequality contexts 