package tofn

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

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

  • author Matthew Kukla
exception OFN_type_mismatch

Incompatible OFN type families.

exception Improper_OFN

An OFN is improper when it has no membership function.

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

Supported families are trapezoidal, Gaussian, and exponential.

type 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.

val sametype : tofn -> tofn -> bool

Determine if two given OFNs are of the same type.

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

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

val 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.

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

OFN addition.

val (|-|) : tofn -> tofn -> tofn

OFN subtraction.

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

OFN multiplication.

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

OFN division

val is_proper : tofn -> bool

Check if an OFN is proper.

val is_increasing : tofn -> bool

Determine if an OFN is increasing.

val is_decreasing : tofn -> bool

Determine if an OFN is decreasing.

val membership : tofn -> float -> float

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

val conv_ofn : tofn -> family -> tofn

Convert an OFN of one type to another type.