<?xml version="1.0" encoding="utf-8"?>
<!--
Cadence Design Systems 


(C) COPYRIGHT, Cadence Design Systems, Inc. 2013
All Rights Reserved
Licensed Materials - Property of Cadence Design Systems

No part of this file may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means electronic, mechanical,
photocopying, recording, or otherwise without prior written permission
of Cadence Design Systems, Inc. 

WARRANTY:
Use all material in this file at your own risk.  Cadence Design Systems
makes no claims about any material contained in this file.
-->
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.cadence.com/xsd/functions"
    xmlns:l="http://www.cadence.com/xsd/functions"
    elementFormDefault="qualified"
    >

    <xs:include schemaLocation="common.xsd"/>

    <xs:element name="root">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="l:function" maxOccurs="unbounded" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="function">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="l:originalScope" minOccurs="0"/>
                <xs:element name="status" type="l:FncStListTp" minOccurs="0"/>
                <xs:element ref="l:rtn" minOccurs="0"/>
                <xs:element ref="l:parameter"  minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="validKinds" type="l:ObjectListTp" minOccurs="0"/>
                <xs:element ref="l:dependency" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="Name" type="xs:string" use="required"/>
            <xs:attribute name="Type">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Unknown"/>
                        <xs:enumeration value="UDMeasurement"/>
                        <xs:enumeration value="PDMeasurement"/>
                        <xs:enumeration value="UDPredicate"/>
                        <xs:enumeration value="PDPredicate"/>
                        <xs:enumeration value="Formula"/>
                        <xs:enumeration value="AnyMeasurement"/>
                        <xs:enumeration value="AnyPredicate"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="Description" type="xs:string"/>
            <xs:attribute name="Version" type="xs:int"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="originalScope" type="l:ObjRefTp"/>
    <xs:element name="rtn">
        <xs:complexType>
            <xs:attribute name="Type" use="required" type="l:legacyDataTypeEnum"/>
            <xs:attribute name="Units" type="l:UnitEnum" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="parameter">
        <xs:complexType>
            <xs:attribute name="Name" type="xs:string" use="required"/>
            <xs:attribute name="Type" type="l:legacyDataTypeEnum"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="dependency">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="parentScope" type="l:ObjRefTp" minOccurs="0"/>
                <xs:element name="parent" type="l:ObjRefTp" minOccurs="0"/>
                <xs:element name="scope" type="l:ObjRefTp"/>
                <xs:element name="object" type="l:ObjRefTp"/>
            </xs:sequence>
            <xs:attribute name="Type" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="object"/>
                        <xs:enumeration value="value"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="UserDefined" type="l:bool"/>
            <xs:attribute name="State" type="l:PropertyNamePattern"/>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="legacyDataTypeEnum">
        <xs:restriction base="xs:string">
            <xs:enumeration value="dBoolean"/>
            <xs:enumeration value="dInteger"/>
            <xs:enumeration value="dDouble"/>
            <xs:enumeration value="dString"/>
            <xs:enumeration value="dEnum">
                <xs:annotation>
                    <xs:documentation>Enum values should be children of &lt;data&gt; and wrapped into &lt;e&gt; each</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="dEnumOrString">
                <xs:annotation>
                    <xs:documentation>Enum values should be children of &lt;data&gt; and wrapped into &lt;e&gt; each</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="dListBoolean"/>
            <xs:enumeration value="dListInteger"/>
            <xs:enumeration value="dListDouble"/>
            <xs:enumeration value="dListString"/>
            <xs:enumeration value="dListEnum"/>
            <xs:enumeration value="dMinDouble"/>
            <xs:enumeration value="dMaxDouble"/>
            <xs:enumeration value="dUtlStringArray"/>
            <xs:enumeration value="dRangeDouble"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>
