package tofn

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module TofnSource

Typed ordered fuzzy numbers (OFNs) and associated operations, following "Rings of Typed Ordered Fuzzy Numbers."

  • author Matthew Kukla
Sourceexception OFN_type_mismatch

Incompatible OFN type families.

Sourceexception Improper_OFN

An OFN is improper when it has no membership function.

Sourcetype family =
  1. | Trapezoidal
  2. | Gaussian
  3. | Exponential

Supported families are trapezoidal, Gaussian, and exponential.

Sourcetype tofn = {
  1. ofn_type : family;
  2. au : float;
  3. bu : float;
  4. ad : float;
  5. bd : float;
}

OFN with type family and essential tuple (au, bu, ad, bd). Components of the tuple are represented as individual fields (as opposed to an element of float * float * float * float) for ease-of-access.

Sourceval sametype : tofn -> tofn -> bool

Determine if two given OFNs are of the same type.

Sourceval tuplemap : (float -> float -> float) -> tofn -> tofn -> tofn

Apply a binary operator to the essential tuples of two OFNs.

Sourceval tuplemap_safe : (float -> float -> float) -> tofn -> tofn -> tofn

Apply a binary operator to the essential tuples of two OFNs only when the types match. Raises OFN_type_mistmatch if arguments are not of the same type.

Sourceval (|+|) : tofn -> tofn -> tofn

OFN addition.

Sourceval (|-|) : tofn -> tofn -> tofn

OFN subtraction.

Sourceval (|*|) : tofn -> tofn -> tofn

OFN multiplication.

Sourceval (|/|) : tofn -> tofn -> tofn

OFN division

Sourceval is_proper : tofn -> bool

Check if an OFN is proper.

Sourceval is_increasing : tofn -> bool

Determine if an OFN is increasing.

Sourceval is_decreasing : tofn -> bool

Determine if an OFN is decreasing.

Sourceval membership : tofn -> float -> float

The membership function associated to an OFN. Raises Improper_OFN if the OFN is improper.

Sourceval conv_ofn : tofn -> family -> tofn

Convert an OFN of one type to another type.