Frame (artificial intelligence)
Frames are an artificial intelligence data structure used to divide knowledge into substructures by representing "stereotyped situations".
They were proposed by Marvin Minsky in his 1974 article "A Framework for Representing Knowledge". Frames are the primary data structure used in artificial intelligence frame languages; they are stored as ontologies of sets.
Frames are also an extensive part of knowledge representation and reasoning schemes. They were originally derived from semantic networks and are therefore part of structure-based knowledge representations.
According to Russell and Norvig's Artificial Intelligence: A Modern Approach, structural representations assemble "facts about particular object and event types and the types into a large taxonomic hierarchy analogous to a biological taxonomy".
Frame structure
The frame contains information on how to use the frame, what to expect next, and what to do when these expectations are not met.Some information in the frame is generally unchanged while other information, stored in "terminals", usually change. Terminals can be considered as variables.
Top-level frames carry information, that is always true about the problem in hand, however, terminals do not have to be true. Their value might change with the new information encountered. Different frames may share the same terminals.
Each piece of information about a particular frame is held in a slot.
The information can contain:
- Facts or Data
- * Values
- Procedures
- * IF-NEEDED: deferred evaluation
- * IF-ADDED: updates linked information
- Default Values
- * For Data
- * For Procedures
- Other Frames or Subframes
Features and advantages
For example, when a person is told "a boy kicks a ball", most people will visualize a particular ball rather than imagining some abstract ball with no attributes.
One particular strength of frame-based knowledge representations is that, unlike semantic networks, they allow for exceptions in particular instances. This gives frames a degree of flexibility that allows representations to reflect real-world phenomena more accurately.
Like semantic networks, frames can be queried using spreading activation. Following the rules of inheritance, any value given to a slot that is inherited by subframes will be updated to the corresponding slots in the subframes and any new instances of a particular frame will feature that new value as the default.
Because frames are based on structures, it is possible to generate a semantic network given a set of frames even though it lacks explicit arcs. References to Noam Chomsky and his generative grammar of 1950 are generally missing from Minsky's work.
The simplified structures of frames allow for easy analogical reasoning, a much prized feature in any intelligent agent. The procedural attachments provided by frames also allow a degree of flexibility that makes for a more realistic representation and gives a natural affordance for programming applications.
Example
Worth noticing here is the easy analogical reasoning that can be done between a boy and a monkey just by having similarly named slots.Also notice that Alex, an instance of a boy, inherits default values like "Sex" from the more general parent object Boy,
but the boy may also have different instance values in the form of exceptions such as the number of legs.
| Slot | Value | Type |
| ALEX | _ | |
| NAME | Alex | |
| ISA | Boy | |
| SEX | Male | |
| AGE | IF-NEEDED: Subtract; | |
| HOME | 100 Main St. | |
| BIRTHDATE | 8/4/2000 | |
| FAVORITE_FOOD | Spaghetti | |
| CLIMBS | Trees | |
| BODY_TYPE | Wiry | |
| NUM_LEGS | 1 |
| Slot | Value | Type |
| BOY | _ | |
| ISA | Person | |
| SEX | Male | |
| AGE | Under 12 yrs. | |
| HOME | A Place | |
| NUM_LEGS | Default = 2 |
| Slot | Value | Type |
| MONKEY | _ | |
| ISA | Primate | |
| SEX | OneOf | |
| AGE | an integer | |
| HABITAT | Default = Jungle | |
| FAVORITE_FOOD | Default = Bananas | |
| CLIMBS | Trees | _ |
| BODY_TYPE | Default = Wiry | |
| NUM_LEGS | Default = 2 |
Frame language
A frame language is a technology used for knowledge representation in artificial intelligence. They are similar to class hierarchies in object-oriented languages although their fundamental design goals are different.Frames are focused on explicit and intuitive representation of knowledge whereas objects focus on encapsulation and information hiding. Frames originated in AI research and objects primarily in software engineering.
However, in practice, the techniques and capabilities of frame and object-oriented languages overlap significantly.
Example
A simple example of concepts modeled in a frame language is the Friend of A Friend ontology defined as part of the Semantic Web as a foundation for social networking and calendar systems.The primary frame in this simple example is a Person.
Example slots are the person's email, home page, phone, etc.
The interests of each person can be represented by additional frames describing the space of business and entertainment domains.
The slot knows links each person with other persons.
Default values for a person's interests can be inferred by the web of people they are friends of.
Implementations
The earliest frame-based languages were custom developed for specific research projects and were not packaged as tools to be re-used by other researchers.Just as with expert system inference engines, researchers soon realized the benefits of extracting part of the core infrastructure and developing general-purpose frame languages that were not coupled to specific applications.
One of the first general-purpose frame languages was KRL. One of the most influential early frame languages was KL-ONE. KL-ONE spawned several subsequent Frame languages.
One of the most widely used successors to KL-ONE was the Loom language developed by Robert MacGregor at the Information Sciences Institute.
In the 1980s, Artificial Intelligence generated a great deal of interest in the business world fueled by expert systems. This led to the development of many commercial products for the development of knowledge-based systems. These early products were usually developed in Lisp and integrated constructs such as IF-THEN rules for logical reasoning with Frame hierarchies for representing data.
One of the most well known of these early Lisp knowledge-base tools was the Knowledge Engineering Environment from Intellicorp. KEE provided a full Frame language with multiple inheritance, slots, triggers, default values, and a rule engine that supported backward and forward chaining. As with most early commercial versions of AI software KEE was originally deployed in Lisp on Lisp machine platforms but was eventually ported to PCs and Unix workstations.
The research agenda of the Semantic Web spawned a renewed interest in automatic classification and frame languages. An example is the Web Ontology Language standard for describing information on the Internet. OWL is a standard to provide a semantic layer on top of the Internet. The goal is that rather than organizing the web using keywords as most applications do today the web can be organized by concepts organized in an ontology.
The name of the OWL language itself provides a good example of the value of a Semantic Web. If one were to search for "OWL" using the Internet today most of the pages retrieved would be on the bird Owl rather than the standard OWL. With a Semantic Web it would be possible to specify the concept "Web Ontology Language" and the user would not need to worry about the various possible acronyms or synonyms as part of the search. Likewise, the user would not need to worry about homonyms crowding the search results with irrelevant data such as information about birds of prey as in this simple example.
In addition to OWL, various standards and technologies that are relevant to the Semantic Web and were influenced by Frame languages include OIL and DAML. The Protege Open Source software tool from Stanford University provides an ontology editing capability that is built on OWL and has the full capabilities of a classifier. However it ceased to explicitly support frames as of version 3.5, with the current version being 5.6.8 as of 2025. The justification for moving from explicit frames being that OWL DL is more expressive and "industry standard".
Comparison of frames and objects
Frame languages have a significant overlap with object-oriented languages. The terminologies and goals of the two communities were different but as they moved from the academic world and labs to the commercial world developers tended to not care about philosophical issues and focused primarily on specific capabilities, taking the best from either camp regardless of where the idea began. What both paradigms have in common is a desire to reduce the distance between concepts in the real world and their implementation in software. As such both paradigms arrived at the idea of representing the primary software objects in taxonomies starting with very general types and progressing to more specific types.The following table illustrates the correlation between standard terminology from the object-oriented and frame language communities:
| Frame terminology | OO terminology |
| Frame | Object class |
| Slot | Object property or attribute |
| Trigger | Accessor and Mutator methods |
| Method | Method |
The primary difference between the two paradigms was in the degree that encapsulation was considered a major requirement. For the object-oriented paradigm encapsulation was one of, if not the most, critical requirement. The desire to reduce the potential interactions between software components and hence manage large complex systems was a key driver of object-oriented technology. For the frame language camp this requirement was less critical than the desire to provide a vast array of possible tools to represent rules, constraints, and programming logic. In the object-oriented world everything is controlled by methods and the visibility of methods. So for example, accessing the data value of an object property must be done via an accessor method. This method controls things such as validating the data type and constraints on the value being retrieved or set on the property. In Frame languages these same types of constraints could be handled in multiple ways. Triggers could be defined to fire before or after a value was set or retrieved. Rules could be defined that managed the same types of constraints. The slots themselves could be augmented with additional information again with the same type of constraint information.
The other main differentiator between frame and OO languages was multiple inheritance. For frame languages multiple inheritance was a requirement. This follows from the desire to model the world the way humans do, human conceptualizations of the world seldom fall into rigidly defined non-overlapping taxonomies. For many OO languages, especially in the later years of OO, single inheritance was either strongly desired or required. Multiple inheritance was seen as a possible step in the analysis phase to model a domain but something that should be eliminated in the design and implementation phases in the name of maintaining encapsulation and modularity.
Although the early frame languages such as KRL did not include message passing, driven by the demands of developers, most of the later frame languages included the ability to define messages on Frames.
On the object-oriented side, standards have also emerged that provide essentially the equivalent functionality that frame languages provided, albeit in a different format and all standardized on object libraries. For example, the Object Management Group has standardized specifications for capabilities such as associating test data and constraints with objects and for integrating rule engines.