Skip to content

Commit

Permalink
Go over Integrals...
Browse files Browse the repository at this point in the history
their arity, and operatorness.

Also fix spelling mistakes caught by mmatera
  • Loading branch information
rocky committed Sep 7, 2024
1 parent c4ba504 commit 16adc20
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 19 deletions.
5 changes: 5 additions & 0 deletions mathics_scanner/data/OperatorTable.csv
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ Cup,Cup,440,340,340,43,43,460,460,{},"{""⌣""}",{},"{{""expr1"", ""⌣"", ""exp
CircleMinus,CircleMinus,430,330,330,44,44,450,450,{},"{""⊖""}",{},"{{""expr1"", ""⊖"", ""expr2""}}","{""CircleMinus"", ""["", ""expr1"", "","", ""expr2"", ""]""}","CircleMinus[expr1, expr2]",Binary,Infix,Left,False,
CirclePlus,CirclePlus,430,330,330,44,44,450,450,{},"{""⊕""}",{},"{{""expr1"", ""⊕"", ""expr2""}}","{""CirclePlus"", ""["", ""expr1"", "","", ""expr2"", ""]""}","CirclePlus[expr1, expr2]",Binary,Infix,None,False,
Sum,Sum,420,320,325,45,45,440,445,"{""∑""}",{},{},"{{""∑"", ""expr""}}","{""Sum"", ""["", ""expr"", ""]""}",Sum[expr],Unary,Prefix,Right,True,Usage and Parse may not be correct.
Integrate,Integral,420,325,325,23,45,455,445,"{""∫""}",{},"{""""}","{{""∫"", ""expr1"", """", ""expr2""}}","{""Integrate"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Integrate[expr1, expr2]",Binary,Compound,Right,True,
ClockwiseContourIntegral,ClockwiseContourIntegral,420,670,325,,45,455,445,"{""∲""}",{},"{""""}","{{""∲"", ""expr1"", """", ""expr2""}}","{""ClockwiseContourIntegral"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Integrate[expr1, expr2]",Binary,Compound,Right,True,Usage and Parse may not be correct.
ContourIntegral,ContourIntegral,420,670,325,,45,455,445,"{""∮""}",{},"{""""}","{{""∮"", ""expr1"", """", ""expr2""}}","{""ContourIntegral"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Integrate[expr1, expr2]",Binary,Compound,Right,True,Usage and Parse may not be correct.
CounterClockwiseContourIntegral,CounterClockwiseContourIntegral,420,670,325,,45,455,445,"{""∳""}",{},"{""""}","{{""∳"", ""expr1"", """", ""expr2""}}","{""CounterClockwiseContourIntegral"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Integrate[expr1, expr2]",Binary,Compound,Right,True,Usage and Parse may not be correct.
DoubleContourIntegral,DoubleContourIntegral,420,670,325,,45,455,445,"{""∯""}",{},"{""""}","{{""∯"", ""expr1"", """", ""expr2""}}","{""DoubleContourIntegral"", ""["", ""expr1"", "","", ""expr2"", ""]""}","Integrate[expr1, expr2]",Binary,Compound,Right,True,Usage and Parse may not be correct.
ExpectationE,ExpectationE,420,325,325,,45,455,445,"{""""}",{},{},"{{"""", ""expr""}}","{""ExpectationE"", ""["", ""expr"", ""]""}",,Unary,Prefix,Right,True,Usage and Parse may not be correct.
ProbabilityPr,ProbabilityPr,420,325,325,,45,455,445,"{""""}",{},{},"{{"""", ""expr""}}","{""ProbabilityPr"", ""["", ""expr"", ""]""}",,Unary,Prefix,Right,True,Usage and Parse may not be correct.
Limit,Limit,410,320,320,,45.5,440,440,"{""""}",{},{},"{{"""", ""expr""}}","{""Limit"", ""["", ""expr"", ""]""}",,Unary,Prefix,Right,True,Usage and Parse may not be correct.
Expand Down
14 changes: 7 additions & 7 deletions mathics_scanner/data/named-characters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
# http://milde.users.sourceforge.net/LUCR/Math/unimathsymbols.pdf
# https://reference.wolfram.com/language/ref/character/....html
# https://github.com/rsmenon/pygments-mathematica
# https://reference.wolfram.com/language/tutorial/OperatorInputForms.html

AAcute:
amslatex: "\\'{a}"
Expand Down Expand Up @@ -1345,11 +1346,11 @@ CircleTimes:
wl-unicode: "\u2297"
wl-unicode-name: CIRCLED TIMES

# See comment under "Integrate".
ClockwiseContourIntegral:
esc-alias: ccint
has-unicode-inverse: false
is-letter-like: false
operator-name: ClockwiseContourIntegral
unicode-equivalent: "\u2232"
unicode-equivalent-name: CLOCKWISE CONTOUR INTEGRAL
wl-unicode: "\u2232"
Expand Down Expand Up @@ -1477,6 +1478,7 @@ ContourIntegral:
esc-alias: cint
has-unicode-inverse: false
is-letter-like: false
operator-name: ContourIntegral
unicode-equivalent: "\u222E"
unicode-equivalent-name: CONTOUR INTEGRAL
wl-unicode: "\u222E"
Expand Down Expand Up @@ -1507,11 +1509,11 @@ Copyright:
wl-unicode: "\xA9"
wl-unicode-name: COPYRIGHT SIGN

# See comment under "Integral".
CounterClockwiseContourIntegral:
esc-alias: cccint
has-unicode-inverse: false
is-letter-like: false
operator-name: CounterClockwiseContourIntegral
unicode-equivalent: "\u2233"
unicode-equivalent-name: ANTICLOCKWISE CONTOUR INTEGRAL
wl-unicode: "\u2233"
Expand Down Expand Up @@ -1915,11 +1917,11 @@ DottedSquare:
unicode-equivalent-name: SQUARE FOUR CORNERS
wl-unicode: "\uF751"

# See comment before "Integral".
DoubleContourIntegral:
amslatex: "\\oiint"
has-unicode-inverse: false
is-letter-like: false
operator-name: DoubleContourIntegral
unicode-equivalent: "\u222F"
unicode-equivalent-name: SURFACE INTEGRAL
wl-unicode: "\u222F"
Expand Down Expand Up @@ -4992,15 +4994,13 @@ Information:
is-letter-like: false
operator-name: Information

# While one might think that Integral is an WL operator, it is not.
# The builtin function name is "Integrate". I imagine part of the
# reason is the complexity in specifying it as an operator which takes
# a min, max, a function, and some sort of derivative partial .
# https://reference.wolfram.com/language/ref/character/Integral.html
Integral:
amslatex: "\\int"
esc-alias: int
has-unicode-inverse: false
is-letter-like: false
operator-name: Integral
unicode-equivalent: "\u222B"
unicode-equivalent-name: INTEGRAL
wl-unicode: "\u222B"
Expand Down
10 changes: 5 additions & 5 deletions mathics_scanner/data/operators-intro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
#
# Precedence-corrected: the value used in Mathics3.

# WolframLangageData: a "PrecedenceRanks" value returned using:
# WolframLangageData[*operator_name*, "PrecedenceRanks"]
# WolframLanguageData: a "PrecedenceRanks" value returned using:
# WolframLanguageData[*operator_name*, "PrecedenceRanks"]
# Example:
# In[1] := WolframLangageData[AddTo, "PrecedenceRanks"]
# In[1] := WolframLanguageData[AddTo, "PrecedenceRanks"]
# Out[1]= {{expr1 +=expr2 , AddTo[expr1 ,expr2]} -> 73
#
# Note that 73 uses a diffrent precedence scheme than the one
Expand All @@ -63,9 +63,9 @@
# Also Note that WolframLanguageData can also be used to give the
# ASCII and unicode character representations:

# In[2] := WolframLangageData[AddTo, "ShortNotations"]
# In[2] := WolframLanguageData[AddTo, "ShortNotations"]
# Out[2]= {+=}
# In[2] := WolframLangageData[GreaterEqual, "ShortNotations"]
# In[2] := WolframLanguageData[GreaterEqual, "ShortNotations"]
# Out[7]= {>=, ≥}
#
# usage: when it exists, an example of the use of this operator
Expand Down
111 changes: 105 additions & 6 deletions mathics_scanner/data/operators.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Autogenerated from operator_csv_to_yaml.py on 2024-09-02 18:54:18.946378
# Autogenerated from operator_csv_to_yaml.py on 2024-09-07 19:43:33.857220
# Information about Wolfram Language named operators.

# This information comes largely from Robert L. Jacobson's Table of
Expand Down Expand Up @@ -52,10 +52,10 @@
#
# Precedence-corrected: the value used in Mathics3.

# WolframLangageData: a "PrecedenceRanks" value returned using:
# WolframLangageData[*operator_name*, "PrecedenceRanks"]
# WolframLanguageData: a "PrecedenceRanks" value returned using:
# WolframLanguageData[*operator_name*, "PrecedenceRanks"]
# Example:
# In[1] := WolframLangageData[AddTo, "PrecedenceRanks"]
# In[1] := WolframLanguageData[AddTo, "PrecedenceRanks"]
# Out[1]= {{expr1 +=expr2 , AddTo[expr1 ,expr2]} -> 73
#
# Note that 73 uses a diffrent precedence scheme than the one
Expand All @@ -64,9 +64,9 @@
# Also Note that WolframLanguageData can also be used to give the
# ASCII and unicode character representations:

# In[2] := WolframLangageData[AddTo, "ShortNotations"]
# In[2] := WolframLanguageData[AddTo, "ShortNotations"]
# Out[2]= {+=}
# In[2] := WolframLangageData[GreaterEqual, "ShortNotations"]
# In[2] := WolframLanguageData[GreaterEqual, "ShortNotations"]
# Out[7]= {>=, ≥}
#
# usage: when it exists, an example of the use of this operator
Expand Down Expand Up @@ -628,6 +628,26 @@ CircleTimes:
meaningful: false
# comments:

ClockwiseContourIntegral:
actual-precedence: 420
Precedence-Function: 670
precedence: 325
WolframLanguageData:
WolframLanguageData-corrected: 45
UnicodeCharacters.tr: 455
UnicodeCharacters-corrected.tr: 445
# N-tokens: {"∲"}
# L-tokens: {}
# O-tokens: {""}
# usage: {{"∲", "expr1", "", "expr2"}}
# parse: {"ClockwiseContourIntegral", "[", "expr1", ",", "expr2", "]"}
FullForm: Integrate[expr1, expr2]
arity: Binary
affix: Compound
associativity: right
meaningful: true
# comments: Usage and Parse may not be correct.

Colon:
actual-precedence: 100
precedence: 80
Expand Down Expand Up @@ -841,6 +861,26 @@ ContinuedFractionK:
meaningful: true
# comments: Usage and Parse may not be correct.

ContourIntegral:
actual-precedence: 420
Precedence-Function: 670
precedence: 325
WolframLanguageData:
WolframLanguageData-corrected: 45
UnicodeCharacters.tr: 455
UnicodeCharacters-corrected.tr: 445
# N-tokens: {"∮"}
# L-tokens: {}
# O-tokens: {""}
# usage: {{"∮", "expr1", "", "expr2"}}
# parse: {"ContourIntegral", "[", "expr1", ",", "expr2", "]"}
FullForm: Integrate[expr1, expr2]
arity: Binary
affix: Compound
associativity: right
meaningful: true
# comments: Usage and Parse may not be correct.

Coproduct:
actual-precedence: 460
precedence: 360
Expand Down Expand Up @@ -880,6 +920,26 @@ CornerBracket:
meaningful: true
# comments:

CounterClockwiseContourIntegral:
actual-precedence: 420
Precedence-Function: 670
precedence: 325
WolframLanguageData:
WolframLanguageData-corrected: 45
UnicodeCharacters.tr: 455
UnicodeCharacters-corrected.tr: 445
# N-tokens: {"∳"}
# L-tokens: {}
# O-tokens: {""}
# usage: {{"∳", "expr1", "", "expr2"}}
# parse: {"CounterClockwiseContourIntegral", "[", "expr1", ",", "expr2", "]"}
FullForm: Integrate[expr1, expr2]
arity: Binary
affix: Compound
associativity: right
meaningful: true
# comments: Usage and Parse may not be correct.

Cross:
actual-precedence: 640
precedence: 500
Expand Down Expand Up @@ -1345,6 +1405,26 @@ DoubleBracketingBar:
meaningful: false
# comments:

DoubleContourIntegral:
actual-precedence: 420
Precedence-Function: 670
precedence: 325
WolframLanguageData:
WolframLanguageData-corrected: 45
UnicodeCharacters.tr: 455
UnicodeCharacters-corrected.tr: 445
# N-tokens: {"∯"}
# L-tokens: {}
# O-tokens: {""}
# usage: {{"∯", "expr1", "", "expr2"}}
# parse: {"DoubleContourIntegral", "[", "expr1", ",", "expr2", "]"}
FullForm: Integrate[expr1, expr2]
arity: Binary
affix: Compound
associativity: right
meaningful: true
# comments: Usage and Parse may not be correct.

DoubleDownArrow:
actual-precedence: 740
precedence: 580
Expand Down Expand Up @@ -2554,6 +2634,25 @@ InlinePart:
meaningful: false
# comments: "InlinePart or @> was an operator that was introduced in one of the pre-release/betas for version 10 and subsequently removed before public release. It was briefly available publicly in the Raspberry Pi version of Wolfram Language that co-existed with the pre-releases at the time. The operator allowed you to access elements of a list with an infix operator." https://mathematica.stackexchange.com/questions/134506/inlinepart-what-is-it-and-what-happened-to-it

Integrate:
actual-precedence: 420
precedence: 325
WolframLanguageData: 23
WolframLanguageData-corrected: 45
UnicodeCharacters.tr: 455
UnicodeCharacters-corrected.tr: 445
# N-tokens: {"∫"}
# L-tokens: {}
# O-tokens: {""}
# usage: {{"∫", "expr1", "", "expr2"}}
# parse: {"Integrate", "[", "expr1", ",", "expr2", "]"}
FullForm: Integrate[expr1, expr2]
arity: Binary
affix: Compound
associativity: right
meaningful: true
# comments:

InterpretationBox:
actual-precedence: 930
Precedence-Function: 670
Expand Down
2 changes: 1 addition & 1 deletion test/test_general_yaml_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_unicode_operators():
operator_name = v["operator-name"]
assert (
k == operator_name
), f"Section name {k} should match operator-name {operator_name} or be exlicitly excluded when a section has an operator"
), f"Section name {k} should match operator-name {operator_name} or be explicitly excluded when a section has an operator"


def test_wl_unicode_name():
Expand Down

0 comments on commit 16adc20

Please sign in to comment.