VOOZH about

URL: https://openmath.org/cd/list1

⇱ list1


👁 OpenMath

OpenMath is an extensible standard for representing the semantics of mathematical objects.

https://openmath.org

http://www.openmath.org/cd/list1.ocd
CD Base:
http://www.openmath.org/cd
CD File:
list1.ocd
CD as XML Encoded OpenMath:
list1.omcd
Defines:
list, map, suchthat
Date:
2004-03-30
Version:
3 (Revision 1)
Review Date:
2006-03-30
Status:
official

 This document is distributed in the hope that it will be useful, 
 but WITHOUT ANY WARRANTY; without even the implied warranty of 
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 The copyright holder grants you permission to redistribute this 
 document freely as a verbatim copy. Furthermore, the copyright
 holder permits you to develop any derived work from this document
 provided that the following conditions are met.
 a) The derived work acknowledges the fact that it is derived from
 this document, and maintains a prominent reference in the 
 work to the original source.
 b) The fact that the derived work is not the original OpenMath 
 document is stated prominently in the derived work. Moreover if
 both this document and the derived work are Content Dictionaries
 then the derived work must include a different CDName element,
 chosen so that it cannot be confused with any works adopted by
 the OpenMath Society. In particular, if there is a Content 
 Dictionary Group whose name is, for example, `math' containing
 Content Dictionaries named `math1', `math2' etc., then you should 
 not name a derived Content Dictionary `mathN' where N is an integer.
 However you are free to name it `private_mathN' or some such. This
 is because the names `mathN' may be used by the OpenMath Society
 for future extensions.
 c) The derived work is distributed under terms that allow the
 compilation of derived works, but keep paragraphs a) and b)
 intact. The simplest way to do this is to distribute the derived
 work under the OpenMath license, but this is not a requirement.
 If you have questions about this license please contact the OpenMath
 society at http://www.openmath.org.
 Author: OpenMath Consortium
 SourceURL: https://github.com/OpenMath/CDs
 

This CD is intended to be `compatible' with MathML list constructs.


Role:
application
Description:

This symbol represents a mapping function which may be used to construct lists, it takes as arguments a function from X to Y and a list over X in that order. The value that is returned is a list of values in Y. The argument list may be a set or an integer_interval.

Example:
The list of even values between 0 and 20 in ascending order, that is the values 2x in ascending order, where x ranges over the integral interval [0,10].
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
 <OMA>
 <OMS cd="list1" name="map"/>
 <OMBIND>
 <OMS cd="fns1" name="lambda"/>
 <OMBVAR>
 <OMV name="x"/>
 </OMBVAR>
 <OMA>
 <OMS cd="arith1" name="times"/>
 <OMI> 2 </OMI>
	<OMV name="x"/>
 </OMA>
 </OMBIND>
 <OMA>
 <OMS cd="interval1" name="integer_interval"/>
 <OMI> 0 </OMI>
 <OMI> 10 </OMI>
 </OMA>
 </OMA>
</OMOBJ>
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <apply><csymbol cd="list1">map</csymbol>
 <bind><csymbol cd="fns1">lambda</csymbol>
 <bvar><ci>x</ci></bvar>
 <apply><csymbol cd="arith1">times</csymbol><cn type="integer">2</cn><ci>x</ci></apply>
 </bind>
 <apply><csymbol cd="interval1">integer_interval</csymbol>
 <cn type="integer">0</cn>
 <cn type="integer">10</cn>
 </apply>
 </apply>
</math>
map (lambda [ x ] . (times ( 2 , x) ) , integer_interval ( 0 , 10 ) )
list1.map(fns1.lambda[$x -> 2 * $x], interval1.integer_interval(0, 10))
Signatures:
sts


Role:
application
Description:

This symbol represents the suchthat function which may be used to construct lists, it takes two arguments. The first argument should be the set which contains the elements of the list, the second argument should be a predicate, that is a function from the set to the booleans which describes if an element is to be in the list returned.

Example:
This example shows how to construct the list of even positive integers less than 100, using the suchthat constructor.
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
 <OMA>
 <OMS cd="list1" name="suchthat"/>
 <OMS cd="setname1" name="Z"/>
 <OMBIND>
 <OMS cd="fns1" name="lambda"/>
 <OMBVAR>
 <OMV name="x"/>
 </OMBVAR>
 <OMA>
 <OMS cd="logic1" name="and"/>
	<OMA>
	 <OMS cd="relation1" name="geq"/>
	 <OMV name="x"/>
	 <OMS cd="alg1" name="zero"/>
	</OMA>
	<OMA>
	 <OMS cd="relation1" name="lt"/>
	 <OMV name="x"/>
	 <OMI> 100 </OMI>
	</OMA>
 <OMA>
 <OMS cd="set1" name="in"/>
	 <OMA>
	 <OMS cd="arith1" name="divide"/>
	 <OMV name="x"/>
	 <OMI> 2 </OMI>
	 </OMA>
	 <OMS cd="setname1" name="Z"/>
 </OMA>
 </OMA>
 </OMBIND>
 </OMA>
</OMOBJ>
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <apply><csymbol cd="list1">suchthat</csymbol>
 <csymbol cd="setname1">Z</csymbol>
 <bind><csymbol cd="fns1">lambda</csymbol>
 <bvar><ci>x</ci></bvar>
 <apply><csymbol cd="logic1">and</csymbol>
 <apply><csymbol cd="relation1">geq</csymbol><ci>x</ci><csymbol cd="alg1">zero</csymbol></apply>
 <apply><csymbol cd="relation1">lt</csymbol><ci>x</ci><cn type="integer">100</cn></apply>
 <apply><csymbol cd="set1">in</csymbol>
 <apply><csymbol cd="arith1">divide</csymbol><ci>x</ci><cn type="integer">2</cn></apply>
 <csymbol cd="setname1">Z</csymbol>
 </apply>
 </apply>
 </bind>
 </apply>
</math>
suchthat (Z, lambda [ x ] . (and (geq ( x, zero) , lt ( x, 100 ) , in (divide ( x, 2 ) , Z) ) ) )
list1.suchthat(setname1.Z, fns1.lambda[$x -> $x >= alg1.zero and $x < 100 and set1.in($x / 2, setname1.Z)])
Signatures:
sts


Role:
application
Description:

This symbol denotes the list construct which is an n-ary function. The list entries must be given explicitly.

Example:
The list 3, 6, 9.
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
 <OMA>
 <OMS cd="list1" name="list"/>
 <OMI> 3 </OMI>
 <OMI> 6 </OMI>
 <OMI> 9 </OMI>
 </OMA>
</OMOBJ>
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <apply><csymbol cd="list1">list</csymbol>
 <cn type="integer">3</cn>
 <cn type="integer">6</cn>
 <cn type="integer">9</cn>
 </apply>
</math>
list ( 3 , 6 , 9 )
[3 , 6 , 9]
Signatures:
sts