Skip to content

Commit

Permalink
correct minor bugs and add tests for "~>"
Browse files Browse the repository at this point in the history
  • Loading branch information
hemmecke committed Jun 22, 2024
1 parent d743332 commit 8e85322
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/algebra/fmt1d.spad
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
---
--- FriCAS Format1D
--- Copyright (C) 2020 Ralf Hemmecke <ralf@hemmecke.org>
--- Copyright (C) 2020, 2024 Ralf Hemmecke <ralf@hemmecke.org>
---
-------------------------------------------------------------------
-- Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -408,7 +408,7 @@ Here we (wrongly) return \verb|+%Infinity| and \verb|-%Infinity| for
o(1, "cot", prefix("cot", MAX, PAREN MIN))
o(1, "csc", prefix("csc", MAX, PAREN MIN))
o(1, "log", prefix("log", MAX, PAREN MIN))
o(1, "sec", prefix("sin", MAX, PAREN MIN))
o(1, "sec", prefix("sec", MAX, PAREN MIN))
o(1, "sin", prefix("sin", MAX, PAREN MIN))
o(1, "tan", prefix("tan", MAX, PAREN MIN))
o(1, "cosh", prefix("cosh", MAX, PAREN MIN))
Expand All @@ -421,6 +421,7 @@ Here we (wrongly) return \verb|+%Infinity| and \verb|-%Infinity| for
o(1, "asin", prefix("asin", MAX, PAREN MIN))
o(1, "atan", prefix("atan", MAX, PAREN MIN))
o(1, "erf", prefix("erf", MAX, PAREN MIN))
o(1, "Gamma", prefix("Gamma", MAX, PAREN MIN))

o(1, "-", prefix("-", 710, FE 715))
o(1, "not", prefix("not ", 710, FE 715))
Expand All @@ -432,7 +433,6 @@ Here we (wrongly) return \verb|+%Infinity| and \verb|-%Infinity| for
o(1, "BRACE", prefix("set", MAX, bracket("[", "]", FE MIN)))
o(1, "BRACKET", bracket("[", "]", FE MIN))
o(1, "PAREN", bracket("(", ")", FE MIN))
o(1, "Gamma", prefix("Gamma", MAX, PAREN MIN))
o(1, "ROOT", prefix("sqrt", MAX, PAREN MIN))
o(1, "SEGMENT", bracket("", " .. ", FE 990))
o(1, "STRING", bracket("_"", "_"", FE MIN))
Expand Down
6 changes: 3 additions & 3 deletions src/algebra/fmt2d.spad
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
---
--- FriCAS Format2D
--- Copyright (C) 2020 Ralf Hemmecke <ralf@hemmecke.org>
--- Copyright (C) 2020, 2024 Ralf Hemmecke <ralf@hemmecke.org>
---
-------------------------------------------------------------------
-- Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -468,7 +468,7 @@ data structure.
o(1, "cot", prefix("cot", MAX, PAREN MIN))
o(1, "csc", prefix("csc", MAX, PAREN MIN))
o(1, "log", prefix("log", MAX, PAREN MIN))
o(1, "sec", prefix("sin", MAX, PAREN MIN))
o(1, "sec", prefix("sec", MAX, PAREN MIN))
o(1, "sin", prefix("sin", MAX, PAREN MIN))
o(1, "tan", prefix("tan", MAX, PAREN MIN))
o(1, "cosh", prefix("cosh", MAX, PAREN MIN))
Expand All @@ -481,6 +481,7 @@ data structure.
o(1, "asin", prefix("asin", MAX, PAREN MIN))
o(1, "atan", prefix("atan", MAX, PAREN MIN))
o(1, "erf", prefix("erf", MAX, PAREN MIN))
o(1, "Gamma", prefix("Gamma", MAX, PAREN MIN))

o(1, "-", prefix("-", 710, FE 715))
o(1, "not", prefix("not ", 710, FE 715))
Expand All @@ -492,7 +493,6 @@ data structure.
o(1, "BRACE", bracket("{", "}", FE MIN))
o(1, "BRACKET", bracket("[", "]", FE MIN))
o(1, "PAREN", bracket("(", ")", FE MIN))
o(1, "Gamma", prefix("Gamma", MAX, PAREN MIN))
o(1, "ROOT", nthRoot(970, FE MIN, FE MIN))
o(1, "SEGMENT", bracket("", " .. ", FE 990))
o(1, "STRING", bracket("_"", "_"", FE MIN))
Expand Down
10 changes: 5 additions & 5 deletions src/algebra/fmtlatex.spad
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
---
--- FriCAS FormatLaTeX
--- Copyright (C) 2014-2015, 2019-2020 Ralf Hemmecke <ralf@hemmecke.org>
--- Copyright (C) 2014-2015, 2019-2020, 2024 Ralf Hemmecke <ralf@hemmecke.org>
---
-------------------------------------------------------------------
-- Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -402,7 +402,7 @@ The operators have been mainly extracted from the definitions of
o(1, "cot", prefix("\cot", 900, PAREN MIN))
o(1, "csc", prefix("\csc", 900, PAREN MIN))
o(1, "log", prefix("\log", 900, PAREN MIN))
o(1, "sec", prefix("\sin", 900, PAREN MIN))
o(1, "sec", prefix("\sec", 900, PAREN MIN))
o(1, "sin", prefix("\sin", 900, PAREN MIN))
o(1, "tan", prefix("\tan", 900, PAREN MIN))
o(1, "cosh", prefix("\cosh", 900, PAREN MIN))
Expand All @@ -415,6 +415,7 @@ The operators have been mainly extracted from the definitions of
o(1, "asin", prefix("\arcsin", 900, PAREN MIN))
o(1, "atan", prefix("\arctan", 900, PAREN MIN))
o(1, "erf", prefix("\erf", 900, PAREN MIN))
o(1, "Gamma", prefix("\Gamma", 900, PAREN MIN))

o(1, "-", prefix("-", 710, FE 715))
o(1, "not", prefix("\lnot ", 710, FE 715))
Expand All @@ -426,7 +427,6 @@ The operators have been mainly extracted from the definitions of
o(1, "BRACE", bracket("\BRACE{", "}", FE MIN))
o(1, "BRACKET", bracket("\BRACKET{", "}", FE MIN))
o(1, "PAREN", bracket("\PAREN{", "}", FE MIN))
o(1, "Gamma", bracket("\Gamma\PAREN{", "}", FE MIN))
o(1, "ROOT", bracket("\sqrt{", "}", FE MIN))
o(1, "SEGMENT", bracket("\SEGMENTi{", "}", FE MIN))
o(1, "STRING", bracket("\STRING{", "}", FE MIN))
Expand Down Expand Up @@ -516,7 +516,7 @@ The operators have been mainly extracted from the definitions of
\begin{verbcode}
%% fricasmath.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright (c) 2014, 2020 Ralf Hemmecke <ralf@hemmecke.org>
%% Copyright (c) 2014, 2020, 2024 Ralf Hemmecke <ralf@hemmecke.org>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -549,7 +549,7 @@ The operators have been mainly extracted from the definitions of
%% OF THE POSSIBILITY OF SUCH DAMAGE.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath}
\usepackage{amsmath,amssymb}
\usepackage[mathstyleoff]{breqn}
\usepackage{tensor}
\usepackage{mleftright}
Expand Down
6 changes: 3 additions & 3 deletions src/algebra/fmtmathjax.spad
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
---
--- FriCAS FormatMathJax
--- Copyright (C) 2020 Ralf Hemmecke <ralf@hemmecke.org>
--- Copyright (C) 2020, 2024 Ralf Hemmecke <ralf@hemmecke.org>
---
-------------------------------------------------------------------
-- Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -444,7 +444,7 @@ data structure.
o(1, "cot", prefix("\cot", 900, PAREN MIN))
o(1, "csc", prefix("\csc", 900, PAREN MIN))
o(1, "log", prefix("\log", 900, PAREN MIN))
o(1, "sec", prefix("\sin", 900, PAREN MIN))
o(1, "sec", prefix("\sec", 900, PAREN MIN))
o(1, "sin", prefix("\sin", 900, PAREN MIN))
o(1, "tan", prefix("\tan", 900, PAREN MIN))
o(1, "cosh", prefix("\cosh", 900, PAREN MIN))
Expand All @@ -457,6 +457,7 @@ data structure.
o(1, "asin", prefix("\arcsin", 900, PAREN MIN))
o(1, "atan", prefix("\arctan", 900, PAREN MIN))
o(1, "erf", prefix("\operatorname{erf}", 900, PAREN MIN))
o(1, "Gamma", prefix("\Gamma", 900, PAREN MIN))

o(1, "-", prefix("-", 710, FE 715))
o(1, "not", prefix("\lnot ", 710, FE 715))
Expand All @@ -468,7 +469,6 @@ data structure.
o(1, "BRACE", bracket("\left\{", "\right\}", FE MIN))
o(1, "BRACKET", bracket("\left[", "\right]", FE MIN))
o(1, "PAREN", bracket("\left(", "\right)", FE MIN))
o(1, "Gamma", bracket("\Gamma\left(", "\right)", FE MIN))
o(1, "ROOT", bracket("\sqrt{", "}", FE MIN))
o(1, "SEGMENT", bracket("", "{\operatorname{..}}", FE MIN))
o(1, "STRING", bracket("\STRING{", "}", FE MIN))
Expand Down
4 changes: 2 additions & 2 deletions src/doc/fricasmath.sty
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%% fricasmath.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright (c) 2014, 2020 Ralf Hemmecke <ralf@hemmecke.org>
%% Copyright (c) 2014, 2020, 2024 Ralf Hemmecke <ralf@hemmecke.org>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -33,7 +33,7 @@
%% OF THE POSSIBILITY OF SUCH DAMAGE.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath}
\usepackage{amsmath,amssymb}
\usepackage[mathstyleoff]{breqn}
\usepackage{tensor}
\usepackage{mleftright}
Expand Down
19 changes: 19 additions & 0 deletions src/input/outputtest.input
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,15 @@ e eq_fn
e eq_fn(a, b)

e eq_fn(a^2, b)

e (a +-> b)
e (moebius(5,4,1,1)$MoebiusTransform(Fraction Integer))

TERM ==> Record(k:Integer,c:Integer)
TERMS ==> List TERM
IDPOZZ ==> IndexedDirectProductObject(Integer, Integer)
e (construct([[1,1],[2,4],[3,9],[4,16]]$TERMS)$IDPOZZ)

addx x == ((y: Integer): Integer +-> x + y);

e addx
Expand Down Expand Up @@ -416,6 +425,16 @@ e rarrow(a, b)

e rarrow(a+b, aa^bb)

e Mapping(Integer, String)

H ==> XHashTable(Symbol, Integer)
ht := table()$H; ht('x1) := 1; ht('x2):=4; ht('x3):=9;
e ht

AL ==> AssociationList(Symbol,Integer)
RSZ ==> Record(key: Symbol, entry: Integer)
al := construct([['x1,1]$RSZ,['x2,4]$RSZ,['x3,9]$RSZ])$AL;
e al

e(a+b)

Expand Down

0 comments on commit 8e85322

Please sign in to comment.