Skip to content

Commit

Permalink
System`Element typos (#830)
Browse files Browse the repository at this point in the history
This PR just fixes a couple of typos in the `Element.m` autoload module
  • Loading branch information
mmatera authored Apr 1, 2023
1 parent c7af29e commit 83d78f1
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions mathics/autoload/rules/Element.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
(*Elementary inexact functions*)
Element[f:(Sin[_]|Cos[_]|Tan[_]|Cot[_]|Sec[_]|Cosec[_]|Sinh[_]|Cosh[_]|Tanh[_]|Coth[_]|Sech[_]|Cosech[_]|
Log[_]|Exp[_]| ArcSin[_]|ArcCos[_]|ArcTan[_]|ArcCot[_]|ArcSec[_]|ArcCosec[_]|
ArcSinh[_]|ArcCosh[_]|ArcTanh[_]|ArcCoth[_]|ArcSech[_]|ArcCosech[_]), domine:Reals|Complexes]:=Element[f[[1]], domine];
ArcSinh[_]|ArcCosh[_]|ArcTanh[_]|ArcCoth[_]|ArcSech[_]|ArcCosech[_]), domain:Reals|Complexes]:=Element[f[[1]], domain];



Expand All @@ -75,29 +75,26 @@
Element[x_, Primes]:=If[Element[x, Algebraics]===True, False, HoldForm[Element[x, Primes]]];


indice=9;

(*General Algebraic*)

Element[z:(_Plus|_Times), domine:(Booleans|Integers|Rationals|Reals|Complexes|Algebraics)]:=Element[Alternatives@@z, domine];
Element[_Times, Primes]:=Element[Alternatives@@z, Primes];
Element[z:(_Plus|_Times), domain:(Integers|Rationals|Reals|Complexes|Algebraics)]:=Element[Alternatives@@z, domain];
Element[z:(_Plus|_Times), Booleans]:=False;
Element[_Times, Primes]:=False;



Element[z_Power, Algebraics]:=Element[Alternatives@@z, Algebraics];
Element[z:(_Integer|_Rational|_Complex), Algebraics]:=True;
Element[I, Algebraics]:=True;
Element[True|False|E|EulerGamma|Khinchin|MachinePrecision|Pi, Algebraics]:=False;
Element[z_DirectedInfinity, domine:(Booleans|Integers|Rationals|Reals|Complexes)]:=False;
Element[z_DirectedInfinity, domain:(Booleans|Integers|Rationals|Reals|Complexes)]:=False;
Element[z_Power, Integers]:= (Element[Alternatives@@z, Integers] && z[[2]]>=0);
Element[z_Power/;Element[Alternatives@@z, ], Integers]:= (z[[2]]>=0);
Element[z_Power/;Element[Alternatives@@z, Integers], Integers]:= (z[[2]]>=0);

Element[z_Power, Complexes]:= Element[z, Algebraics];
Element[Power[b_,p_], Rationals]:=Element[b, Rationals] && Element[p, Integers] ;


indice=10;




Element[Sin[_]|Cos[_]|Tan[_]|Cot[_]|Sec[_]|Cosec[_]|
Expand All @@ -109,11 +106,8 @@



indice=11;


Element[Power[b_Real|b_Rational|b_Integer, _Real|_Rational], Reals]:= (b>=0);
Element[Power[_Real|_Rational|_Integer, p_Integer], Reals]:= True;
Element[Power[_Real|_Rational|_Integer, p_Integer], Reals]= True;
Element[Power[b_/;(Element[b, Reals]), p_/;Element[p, Reals]], Reals]:=(Element[p, Integers] || b>=0);

Protect[Element]
Expand Down

0 comments on commit 83d78f1

Please sign in to comment.