A function is a mapping from a domain to a range that associates a domain element with exactly one range element. The elements of the domain are tuples, as in relations. The range is a class -- a set of singleton tuples -- and element of the range is an instance of the class. Functions are also first-class objects in the same sense that relations are objects: namely, functions can be viewed as sets of tuples.Notes:
- Originally defined in the KIF-RELATIONS ontology
(=> (Function ?Relation) (Forall (?Tuple1 ?Tuple2) (=> (Member ?Tuple1 ?Relation) (Member ?Tuple2 ?Relation) (= (Butlast ?Tuple1) (Butlast ?Tuple2)) (= (Last ?Tuple1) (Last ?Tuple2)))))
(<=> (Function ?Relation) (And (Relation ?Relation) (Forall (?Tuple1 ?Tuple2) (=> (Member ?Tuple1 ?Relation) (Member ?Tuple2 ?Relation) (= (Butlast ?Tuple1) (Butlast ?Tuple2)) (= (Last ?Tuple1) (Last ?Tuple2))))))
(=> (One-One ?R) (Function ?R)) (=> (Many-One ?R) (Function ?R)) (=> (Many-Many ?R) (Not (Function (Inverse ?R)))) (=> (Many-Many ?R) (Not (Function ?R))) (=> (Unary-Function ?F) (Function ?F))
(<=> (One-One ?R) (And (Binary-Relation ?R) (Function ?R) (Value-Type@Frame-Ontology ?R Inverse Function) (Value-Cardinality@Frame-Ontology ?R Inverse 1))) (<=> (Many-One ?R) (And (Binary-Relation ?R) (Function ?R))) (<=> (One-Many ?R) (And (Binary-Relation ?R) (Value-Type@Frame-Ontology ?R Inverse Function) (Value-Cardinality@Frame-Ontology ?R Inverse 1))) (<=> (Many-Many ?R) (And (Binary-Relation ?R) (Not (Function ?R)) (Not (Function (Inverse ?R))))) (<=> (Unary-Function ?F) (And (Function ?F) (Binary-Relation ?F)))