diff --git a/Sources/Terminal/AngouriMath.Terminal.Lib/OneShot.fs b/Sources/Terminal/AngouriMath.Terminal.Lib/OneShot.fs index 624f5be9b..007786264 100644 --- a/Sources/Terminal/AngouriMath.Terminal.Lib/OneShot.fs +++ b/Sources/Terminal/AngouriMath.Terminal.Lib/OneShot.fs @@ -22,8 +22,8 @@ let usage = amcli eval EXPR evaluates to a number, a boolean, or a + bi amcli simp EXPR simplifies amcli fsimp EXPR simplifies quickly: the normalisation, without the search -amcli diff VAR EXPR differentiates over VAR -amcli solve VAR STATEMENT solves over VAR, one root per line when there are finitely many +amcli diff VAR EXPR differentiates with respect to VAR +amcli solve VAR STATEMENT solves for VAR, one root per line when there are finitely many amcli sub VAR VALUE EXPR substitutes VALUE for VAR amcli latex EXPR writes EXPR as LaTeX amcli info EXPR its variables, derivatives, roots and stationary points @@ -84,7 +84,7 @@ let private kindOfStationaryPoint (hessian: int -> int -> Entity) (size: int) = else "a saddle point" /// -/// The lines amcli info prints: the variables, the derivative and the roots over each, and +/// The lines amcli info prints: the variables, the derivative and the roots for each, and /// the stationary points, each classified by the second derivative test. /// let private describe (expression: Entity) = @@ -92,9 +92,9 @@ let private describe (expression: Entity) = let names = String.Join(", ", variables) [ yield $"variables: {names}" for v in variables do - yield $"derivative over {v}: {expression.Differentiate(v).Simplify().Stringize()}" + yield $"derivative with respect to {v}: {expression.Differentiate(v).Simplify().Stringize()}" for v in variables do - yield $"roots over {v}: {expression.Equalizes(Entity.Number.Integer.Zero).Solve(v).Simplify().Stringize()}" + yield $"roots for {v}: {expression.Equalizes(Entity.Number.Integer.Zero).Solve(v).Simplify().Stringize()}" match variables with | [] -> () | [ v ] -> diff --git a/Sources/Terminal/AngouriMath.Terminal/amcli.1 b/Sources/Terminal/AngouriMath.Terminal/amcli.1 index 80955f7f7..f619b4f78 100644 --- a/Sources/Terminal/AngouriMath.Terminal/amcli.1 +++ b/Sources/Terminal/AngouriMath.Terminal/amcli.1 @@ -37,13 +37,13 @@ quickly: the normalisation, without the search. .BI diff " var expr" Differentiates .I expr -over +with respect to .IR var . .TP .BI solve " var statement" Solves .I statement -over +for .IR var , one root per line when there are finitely many. .TP @@ -63,7 +63,7 @@ as LaTeX. .BI info " expr" Describes .IR expr : -its variables, the derivative and the roots over each, and its stationary points, each classified +its variables, the derivative and the roots for each, and its stationary points, each classified by the second derivative test. .TP .B help diff --git a/Sources/Terminal/readme.md b/Sources/Terminal/readme.md index 306fdec43..5e96f5ced 100644 --- a/Sources/Terminal/readme.md +++ b/Sources/Terminal/readme.md @@ -44,7 +44,7 @@ $ echo "1 + x^2" | amcli diff x The commands are `eval`, `simp`, `fsimp`, `diff`, `solve`, `sub`, `latex` and `info`, and `amcli help` says what each takes. `info` describes an expression: its variables, the derivative -and the roots over each, and its stationary points, each classified by the second derivative +and the roots for each, and its stationary points, each classified by the second derivative test. An argument written as `_`, or left out, is read from stdin. The exit code is 0 for an answer, 1 when the input does not parse or cannot be answered, and 2 for a command that does not exist or is missing an argument. These are the commands of the earlier standalone diff --git a/Sources/Tests/TerminalUnitTests/OneShotTest.fs b/Sources/Tests/TerminalUnitTests/OneShotTest.fs index 6e2e75ad7..f447bd146 100644 --- a/Sources/Tests/TerminalUnitTests/OneShotTest.fs +++ b/Sources/Tests/TerminalUnitTests/OneShotTest.fs @@ -110,10 +110,10 @@ let ``info classifies each stationary point`` (expression: string) (expected: st Assert.Contains(expected, printed.Split('\n')) [] -let ``info names the variables and gives the derivative and the roots over each`` () = +let ``info names the variables and gives the derivative and the roots for each`` () = let code, printed, _ = run [ "info"; "x^2 - 4" ] "" Assert.Equal(0, code) let lines = printed.Split('\n') Assert.Contains("variables: x", lines) - Assert.Contains("derivative over x: 2 * x", lines) - Assert.Contains(lines, fun line -> line.StartsWith("roots over x: ") && line.Contains("-2") && line.Contains("2")) + Assert.Contains("derivative with respect to x: 2 * x", lines) + Assert.Contains(lines, fun line -> line.StartsWith("roots for x: ") && line.Contains("-2") && line.Contains("2"))