Skip to content

Commit

Permalink
Merge pull request maths#1351 from maths/iss1348
Browse files Browse the repository at this point in the history
Fix to issue maths#1348.
sangwinc authored Jan 6, 2025
2 parents 7a41fc3 + 03fcc14 commit 8cae594
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/en/Authoring/Inputs/index.md
Original file line number Diff line number Diff line change
@@ -106,6 +106,7 @@ If you wish to forbid commas, then escape it with a backslash.
There are groups of common keywords which you can forbid simply as

* `[[BASIC-ALGEBRA]]` common algebraic operations such as `simplify`, `factor`, `expand`, `solve`, etc.
* `[[BASIC-TRIG]]` names of all the trig and hyperbolic trig functions and their inverses, e.g. `sin`, `asin`, `sinh`, `asinh`, etc.
* `[[BASIC-CALCULUS]]` common calculus operations such as `int`, `diff`, `taylor`, etc.
* `[[BASIC-MATRIX]]` common matrix operations such as `transpose`, `invert`, `charpoly`, etc.

7 changes: 7 additions & 0 deletions stack/cas/cassecurity.class.php
Original file line number Diff line number Diff line change
@@ -73,6 +73,13 @@ class stack_cas_security {
'trigrat' => true, 'trigreduce' => true, 'trigsign' => true,
'trigsimp' => true, 'truncate' => true, 'decimalplaces' => true, 'simplify' => true,
],
'[[basic-trig]]' => [
'sin' => true, 'cos' => true, 'tan' => true, 'sec' => true, 'csc' => true, 'cot' => true,
'asin' => true, 'acos' => true, 'atan' => true, 'asec' => true, 'acsc' => true, 'acot' => true,
'atan2' => true,
'sinh' => true, 'cosh' => true, 'tanh' => true, 'sech' => true, 'csch' => true, 'coth' => true,
'asinh' => true, 'acosh' => true, 'atanh' => true, 'asech' => true, 'acsch' => true, 'acoth' => true,
],
'[[basic-calculus]]' => [
'defint' => true, 'diff' => true, 'int' => true, 'integrate' => true,
'limit' => true, 'partial' => true, 'desolve' => true, 'express' => true, 'taylor' => true,
2 changes: 1 addition & 1 deletion stack/maxima/assessment.mac
Original file line number Diff line number Diff line change
@@ -542,7 +542,7 @@ polarform_simp(ex) := block([%_r, %_theta, %_pf,simp],
*/


/* Decides if an expression is precicely of the form a*10^n, where a is an integer, or a float, and n is an integer. */
/* Decides if an expression is precisely of the form a*10^n, where a is an integer, or a float, and n is an integer. */
scientific_notationp(ex) := block([tn],
if not(safe_op(ex)="*") then return(false),
if not(length(args(ex))=2) then return(false),
1 change: 1 addition & 0 deletions tests/ast_container_test.php
Original file line number Diff line number Diff line change
@@ -324,6 +324,7 @@ public function test_check_external_forbidden_words_literal(): void {
['[x,y,z]', 'b,\,,c', false],
['diff(x^2,x)', '[[BASIC-CALCULUS]]', false], // From lists.
['solve((x-6)^4,x)', '[[BASIC-ALGEBRA]]', false], // From lists.
['sin(A-B)', '[[BASIC-TRIG]]', false], // From lists.
];

foreach ($cases as $case) {

0 comments on commit 8cae594

Please sign in to comment.