The KIF vocabulary for lists as defined in the KIF 3.0 specification.
Kif-Numbers
Kif-Ontology Kif-Meta Configuration-Design Vt-Design Simple-Bikes Vt-Domain Vt-Example Kif-Ontology Kif-Relations Frame-Ontology Vt-Domain ... Configuration-Design ... Physical-Quantities Unary-Scalar-Functions Cml Thermodynamics Dme Thermodynamics Standard-Units Simple-Bikes Cml ... Vt-Design ... Unary-Scalar-Functions ... Scalar-Quantities Vt-Design ... Vector-Quantities Abstract-Algebra Physical-Quantities ... Jat-Generic Job-Assignment-Task Generic-Bibliography Slot-Constraint-Sugar Generic-Bibliography Kif-Ontology
List Null Single Double Triple String
The following constants were used from included theories:
The following constants were used from theories not included:
All constants that were mentioned were defined.
A list is a sequence --- an ordered bag --- of elements. It is KIF primitive.
True of the list with no items.
Slots Of Instances:
(<=> (Null ?List) (And (List ?List) (= (Length ?List) 0)))
The list with no items, of length 0. All null lists are equal to this object, called NIL.
LISTOF is the sequence constructor function for KIF. It takes any finite number of arguments and denotes the list (i.e., sequence, tuple) of those items.
(Undefined (Arity Listof))
A list of length 1.
Slots Of Instances:
(<=> (Single ?List) (And (List ?List) (= (Length ?List) 1)))
A list of length 2.
Slots Of Instances:
(<=> (Double ?List) (And (List ?List) (= (Length ?List) 2)))
A list of length 3.
Slots Of Instances:
(<=> (Triple ?List) (And (List ?List) (= (Length ?List) 3)))
(<=> (First ?List ?Result) (And (Exists (@Items) (= (Listof ?X @Items) ?List)) (= ?X ?Result) ))
the SECOND of a list is the second item in the list. It is undefined if the length of the list is not at least 2.
(= (Second ?List) (First (Rest ?List)))
(<=> (Rest ?List ?Rest-List) (Or (And (Null ?List) (= ?Rest-List ?List)) (Exists (?X @Items) (And (= ?List (Listof ?X @Items)) (= ?Rest-List (Listof @Items)) ))))
(= (Last ?List) (Cond ((Null ?List) Bottom) ((Null (Rest ?List)) (First ?List)) (True (Last (Rest ?List))) ))
(= (Butlast ?List) (Cond ((Null ?List) Bottom) ((Null (Rest ?List)) Nil) (True (Cons (First ?List) (Butlast (Rest ?List)))) ))
The sentence {tt (item $tau_1$ $tau_2$)} is true if and only if the object denoted by $tau_2$ is a non-empty list and the object denoted by $tau_1$ is either the first item of that list or an item in the rest of the list.
(=> (Item ?X ?List) (And (Not (Null ?List)) (Or (= ?X (First ?List)) (Item ?X (Rest ?List))) ))
The sentence {tt (sublist $tau_1$ $tau_2$)} is true if and only if the object denoted by $tau_1$ is a final segment of the list denoted by $tau_2$.
(=> (Sublist ?L1 ?L2) (Or (= ?L1 ?L2) (Sublist ?L1 (Rest ?L2))))
The function {tt cons} adds the object specified as its first argument to the front of the list specified as its second argument.
(Nth-Domain Cons 3 List) (Nth-Domain Cons 2 List) (<=> (Cons ?X ?List ?New-List) (And (= ?List (Listof @L)) (= (Listof ?X @L) ?New-List)) )
The function {tt append} adds the items in the list specified as its first argument to the list specified as its second argument. .
(Nth-Domain Append 3 List) (Nth-Domain Append 2 List) (Nth-Domain Append 1 List) (= (Append ?L1 ?L2) (If (Null ?L1) (If (List ?L2) ?L2) (Cons (First ?L1) (Append (Rest ?L1) ?L2)) ))
The function {tt revappend} is similar to append, except that it adds the items in reverse order.
(Nth-Domain Revappend 3 List) (Nth-Domain Revappend 2 List) (Nth-Domain Revappend 1 List) (= (Revappend ?L1 ?L2) (If (Null ?L1) (If (List ?L2) ?L2) (Revappend (Rest ?L1) (Cons (First ?L1) ?L2)) ))
The function {tt reverse} produces a list in which the order of items is the reverse of that in the list supplied as its single argument.
(= (Reverse ?List) (Revappend ?List (Listof)))
The functions {tt adjoin} and {tt remove} construct lists by adding or removing objects from the lists specified as their arguments.
(Nth-Domain Adjoin 3 List) (Nth-Domain Adjoin 2 List) (= (Adjoin ?X ?List) (If (Item ?X ?List) ?List (Cons ?X ?List)))
The functions {tt adjoin} and {tt remove} construct lists by adding or removing objects from the lists specified as their arguments.
(Nth-Domain Remove 3 List) (Nth-Domain Remove 2 List) (= (Remove ?X ?List) (Cond ((Null ?List) Nil) ((And (= ?X (First ?List)) (List ?List)) (Remove ?X (Rest ?List)) ) ((List ?List) (Cons ?X (Remove ?X (Rest ?List)))) ))
The value of {tt subst} is the object or list obtained by substituting the object supplied as first argument for all occurrences of the object supplied as second argument in the object or list supplied as third argument.
(= (Subst ?X ?Y ?Z) (Cond ((= ?Y ?Z) ?X) ((Null ?Z) Nil) ((List ?Z) (Cons (Subst ?X ?Y (First ?Z)) (Subst ?X ?Y (Rest ?Z))) ) (True ?Z) ))
The function constant {tt length} gives the number of items in a list.
(= (Length ?List) (Cond ((Null ?List) 0) ((List ?List) (1+ (Length (Rest ?List))))) )
{tt nth} returns the item in the list specified as its first
argument in the position specified as its second argument.
(Nth-Domain Nth 2 Natural) (Nth-Domain Nth 1 List) (= (Nth ?List ?N) (Cond ((= ?N 1) (First ?List)) ((Positive ?N) (Nth (Rest ?List) (1- ?N))) ))
{tt nthrest} returns the list specified as its first argument
minus the first $n$ items, where $n$ is the number specified as its second argument.
(Nth-Domain Nthrest 3 List) (Nth-Domain Nthrest 2 Natural) (Nth-Domain Nthrest 1 List) (= (Nthrest ?List ?N) (Cond (True Bottom)))
A string is a sequence of characters.