View on GitHub

Exact p-Adics

A Magma package for exact p-adic computation

Miscellany

Bits and bobs not belonging to the main features of the package, but needed by the package and useful nonetheless.

Contents

Profiling

To help isolate the slow parts of code, we provide some profiling tools.

ExactpAdics_SetProfile (doProfile :: BoolElt)

Turn profiling on or off.

Parameters

ExactpAdics_GetProfile ()

-> BoolElt

True if profiling is enabled.

ExactpAdics_ResetProfile ()

Resets the profile.

ExactpAdics_GetProfileUpdates ()

-> []

Returns the profile, a sequence of records for each update with the following fields:

Default associative arrays

The new type AssocDflt is an associative array with a default value. Hence it may be used to describe a function which is constant save for finitely many exceptions.

IsCoercible_DefaultAssociativeArray (x)

-> BoolElt, AssocDflt

True if we can create a default associative array with default x.

IsCoercible_DefaultAssociativeArray (x, keys, values)

-> BoolElt, AssocDflt

True if we can create a default associative array with default x and given keys and values.

IsCoercible_DefaultAssociativeArray (x, y)

IsCoercible_DefaultAssociativeArray (x, y :: Assoc)

IsCoercible_DefaultAssociativeArray (x, y :: [Tup])

-> BoolElt, AssocDflt

True if we can create a default associative array with default x and values y.

DefaultAssociativeArray (x)

-> AssocDflt

The default associative array with default value x.

DefaultAssociativeArray (x, ys)

-> AssocDflt

The default associative array with default value x and keys and values specified by ys (an associative array or sequence of <key,value> pairs).

DefaultAssociativeArray (x, keys, values)

-> AssocDflt

The default associative array with default value x, and given keys and values.

Print (x :: AssocDflt, lvl :: MonStgElt)

Print.

'@' (i, x :: AssocDflt)

-> Any

The value at index i of x.

ApplyPointwise (f, x :: AssocDflt, y :: AssocDflt)

-> AssocDflt

Applies the function f pointwise to values of x and y.

ApplyPointwise (f, x :: AssocDflt)

-> AssocDflt

Applies the function f pointwise to values of x.

Image (x :: AssocDflt)

-> {}

The set of possible output values.

DefaultValue (x :: AssocDflt)

-> Any

The default value of x.

SpecialAssociativeArray (x :: AssocDflt)

-> Assoc

The associative array of the special values of x.

SpecialKeys (x :: AssocDflt)

-> Assoc

The keys of special values of x.

Zip (xs :: [AssocDflt])

-> AssocDflt

The array [i] -> [x(i) : x in xs]. The inputs must have compatible indices.

ZipApplyPointwise (f, xs :: [AssocDflt])

-> AssocDflt

The array [i] -> f([x(i) : x in xs]). Equivalent to ApplyPointwise(f,Zip(xs)).

ForAll (x :: AssocDflt, f)

-> BoolElt

True if f(x(i)) is true for all i.

ForAll (x :: AssocDflt, y :: AssocDflt, f)

-> BoolElt

True if f(x(i),y(i)) is true for all i.

Warnings

For controlling the extent to which errors and warnings occur in the ExactpAdics package.

ExactpAdics_SetWarningAction (name :: MonStgElt, action :: MonStgElt)

Sets how the warning name is displayed. action is one of:

ExactpAdics_WarningActionIsDefined (name :: MonStgElt)

-> BoolElt, MonStgElt

True if there is a warning action defined for warning name. If so, also returns the action.

ExactpAdics_GetWarningAction (name :: MonStgElt, dflt :: MonStgElt)

-> MonStgElt

The warning action set for warning name, if set, or else dflt.

ExactpAdics_Warn (name :: MonStgElt, msg)

Raises the warning name with message msg.

Parameters

Promotion

A basic scheme for promoting values in different structures to a common strucure.

IsPromotable (x, y)

-> BoolElt, Any, Any

True if x and y are promotable to the same parent.

Promote (x, y)

-> Any, Any

Promotes x and y to a common type.

Lower bounds

A ExactpAdics_BndLow is a lower bound on a possibly unknown value.

ExactpAdics_LowerBound (v)

-> ExactpAdics_BndLow

The lower bound v.

Parameters

IsSharp (b :: ExactpAdics_BndLow)

-> BoolElt

True if b is a sharp bound.

BoundValue (b :: ExactpAdics_BndLow)

-> Any

The lower bound.

Value (b :: ExactpAdics_BndLow)

-> Any

The value of b, assuming it is sharp.

Print (b :: ExactpAdics_BndLow, lvl :: MonStgElt)

Print.

'&+' (bs :: [ExactpAdics_BndLow])

-> ExactpAdics_BndLow

Lower bound on the sum of the values being bounded.

Max (bs :: [ExactpAdics_BndLow])

-> ExactpAdics_BndLow

Lower bound on the maximum of the values being bounded.

Min (bs :: [ExactpAdics_BndLow])

-> ExactpAdics_BndLow

Lower bound on the minimum of the values being bounded.