Definition of a Structured Verification in Maple - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Logic : Boolean : verify : verify/structured

Definition of a Structured Verification in Maple

 

Description

Examples

Description

• 

A structured verification is a Maple expression other than a symbol which can be interpreted as a verification. A typical example would be simplify,simplify. This specifies that the two objects must be lists with two operands, and that each pair of operands must have the property that their difference when simplified, equals zero.

• 

This help page first gives a formal grammatical description of the valid structured verifications, then notes on some of the special verifications, and lastly, examples.

• 

In the formal definition below, read "::=" to mean "is defined to be", "|" to mean "or", and "*" to mean "zero or more occurrences of".

 

Syntax

Matches

 

 

 

verification ::=

{ verification* }

alternation; any of the verifications

 

| [ verification* ]

a list of the given verifications

 

| complex(numeric)

match complex numerical constants exactly

 

| string

match strings exactly

 

| verification = verification

an equation of the corresponding verifications

 

| verification <> verification

an inequality compared with given verifications

 

| verification < verification

a relation compared with given verifications

 

| verification <= verification

a relation compared with given verifications

 

| verification > verification

a relation compared with given verifications

 

| verification >= verification

a relation compared with given verifications

 

| verification .. verification

a range compared with given verifications

 

| verification and verification

an AND of the corresponding verifications

 

| verification or verification

an OR of the corresponding verifications

 

| not verification

a NOT of the corresponding verification

 

| verification &+ verification ...

a sum of the corresponding verifications

 

| verification &* verification ...

a product of the corresponding verifications

 

| verification &. verification ...

a dot product of the corresponding verifications

 

| verification ^ verification

a power compared with the given verifications

 

| fcnverification

a function or special verification

 

 

 

fcnverification ::=

set(verification)

sets of elements compared with the given verification

 

| list(verification)

lists of elements compared with the given verification

 

| `&+`(verification)

a sum of terms of the given verifications

 

| `&*`(verification)

a product of factors of the given verifications

 

| specfunc(verification,foo)

the function foo with arguments compared with the given verification

 

| anyfunc(verification*)

any functions with arguments compared with the given verifications

 

| function(verification)

any function with arguments compared with given verification

 

| name(verification)

any name with a value of the given verification

 

| foo(verification*)

a verification defined by a procedure addverify(foo::name, bar::procedure)

 

| foo(verification*)

the function foo with arguments compared with the given verifications

 

 

 

• 

The square brackets [ and ] are used to check for a fixed argument sequence.  The verification boolean&comma;simplify checks the equality of two lists, each with exactly 2 arguments, the first checked with simple equality and the second with simplify.

• 

The set brackets { and } are used for alternation.  The verification {set(float(10)),list(float(10))} matches either lists or sets of floating-point numbers which are considered equal if they are within 10 units in the last place.

• 

The verification boolean does a simple comparison.

• 

The verifications identicalexpr compares two objects, complex(numeric) or string, to the expression expr.

• 

The verification anyfunct1,...,tn matches any two functions with n arguments where the arguments agree according to the appropriate verifications.

• 

The verification specfunc(ver, n) matches functions n with 0 or more arguments where the arguments agree according to the verification ver.  Thus verify(f, g, specfunc(ver, n)) is equivalent to all five of the forms, type(f, function), type(g, function), op0&comma;f&equals;n, op0&comma;g&equals;n, and verify([op(f)], [op(g)], list(ver)).

Examples

verifystring&comma;string&comma;identicalstring

true

(1)

verifyevalfabs1&comma;x&plus;1cos22&comma;abs1&comma;x&plus;sin2.&comma;&apos;abs1&comma;polynomfloat1&comma;x&apos;

true

(2)

verifyx212.0002&comma;x1x&plus;12.00003&comma;&apos;normalfloat1.106&apos;

true

(3)

evalb2.&comma;1x2&equals;2&comma;1x1&plus;x

false

(4)

verify2.0000001&comma;1x2&comma;2&comma;1x1&plus;x&comma;&apos;float10000.&comma;expand&apos;

true

(5)

verify0.32&comma;0.320002&comma;0.319996&comma;&apos;setfloat1.105&apos;

true

(6)

verifyevalrsinINTERVAL1..1.5&comma;INTERVAL0.9974949866..sin1&comma;&apos;INTERVALfloat1..boolean&apos;

true

(7)

solnsdsolveDfx&equals;fx&comma;fx

solns:=fx&equals;_C1&ExponentialE;x

(8)

verifysolns&comma;fx&equals;_C1coshx&plus;sinhx&comma;boolean&equals;testeq

true

(9)

zerocosx2&plus;sinx21&comma;x21x1x&plus;1&comma;0.&comma;calog&lsqb;a&rsqb;c

zero:=0.&comma;calnclna&comma;x21x1x&plus;1&comma;cosx2&plus;sinx21

(10)

verify0&comma;zero&comma;setsimplify

true

(11)

See Also

verify

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam