it.grypho.scala.leonardo.domain

Domain analysis as a user-facing question.

The analysis itself lives in scalar (scalar.domainOf, scalar.singularitiesOf), because scalar.integrate and scalar.Limit have to be able to call it as a guard. It therefore answers in a neutral DomainSet, which is not a predicate in the language. This package is the other half of that split: it renders a DomainSet into the relation nodes a user reads — _Comparison, and, or, _Bool.

A separate package rather than nodes in equation, for two reasons: a domain is not a relation, and the project's convention is one package per domain. It imports core + scalar + equation + logic, which is acyclic — nothing imports it but parser.

What cannot be rendered stays symbolic. tan's excluded points and the Gamma poles are infinite sets, and the language has no quantifier, so domain(tan(x), x) does not reduce. Emitting a truncated list of exclusions would read as exhaustive, which is the failure mode this package exists to avoid.

Attributes

Members list

Type members

Classlikes

case class _Differentiable(e: _Expression, v: _Variable, kind: DomainKind) extends _Expression

differentiable(e, v) — where e is differentiable, written as a relation in v.

differentiable(e, v) — where e is differentiable, written as a relation in v.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait _Expression
class Object
trait Matchable
class Any
Show all
case class _Domain(e: _Expression, v: _Variable, kind: DomainKind) extends _Expression

domain(e, v) — where e is defined, written as a relation in v.

domain(e, v) — where e is defined, written as a relation in v.

v follows the scalar._Taylor convention rather than the binder convention: it appears free in the result (x > 0), so it is excluded from children but carried through rebuild so substitute cannot rewrite the variable the answer is phrased in.

Stays symbolic when the domain cannot be written down — see the package overview.

Value parameters

e

the expression to analyse

kind

real or complex

v

the variable the answer is expressed in

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait _Expression
class Object
trait Matchable
class Any
Show all
case class _Singularities(e: _Expression, v: _Variable) extends _Expression

singularities(e, v) — the isolated singularities of a rational e.

singularities(e, v) — the isolated singularities of a rational e.

Three outcomes, deliberately distinguishable:

  • some — a 2×n matrix, locations in the first row and pole order in the second, with 0 marking a removable singularity. Two rows rather than one because the order is the part the Laurent series actually needs — it is the length of the principal part — and a bare list of locations would lose it.
  • provably none_Bool(false), the empty set. This follows the inequality solver, which renders an empty solution set the same way, and _Matrix cannot be 2×0 in any case.
  • cannot enumerate — stays symbolic, which is everything that is not a numeric rational function. Collapsing this into "none" would turn "I do not know" into a confident and wrong answer.

Varying the result type by cardinality is the convention equation._Solve already uses: one solution is an equation, several are a matrix, none stays symbolic.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait _Expression
class Object
trait Matchable
class Any
Show all