## Exercise: Microtheories and Inferencing

E-Mail Comments to: opencyc-doc@cyc.com
Last Update: 03/28/2002
Copyright© 1997-2002 Cycorp. All rights reserved. See Terms of Usage.

Return to Table of Contents

### Step 1: Preliminary knowledge entry

First, locate or create the constant January, and verify these facts are present, asserting them if necessary:

        (#$isa #$January #$MonthOfYearType)
        (#$genls #$MonthOfYearType #$TemporalObjectType)
        (#$genls #$January #$CalendarMonth)

Next, locate or create the constant NewYearsDay, and assert, if necessary:

        (#$isa #$NewYearsDay #$TemporalObjectType)

### Step 2: Creating new microtheories

Now locate or create the GeneralMicrotheory NorthernHemisphereMt; after creating it, assert:

        (#$isa #$NorthernHemisphereMt #$GeneralMicrotheory)

In this Mt, assert:

        (#$subsumesIntervalType #$CalendarWinter #$January)

Next, create the GeneralMicrotheory WesternCultureMt; as with NorthernHemisphereMt, assert:

        (#$isa #$WesternCultureMt #$GeneralMicrotheory)

In this Mt, assert:

        (#$genls #$NewYearsDay #$LegalHoliday)
        (#$subsumesIntervalType #$January #$NewYearsDay)

Now create NorthAmericanCultureMt as an instance of GeneralMicrotheory .

Make NorthernHemisphereMt and WesternCultureMt genlMts of NorthAmericanCultureMt.

### Step 3: Querying within Microtheories

Go to the Ask interface, and set these resource constraints:

- Get everything
- Run for 20 seconds
- Backchain for 2 steps
- Limit total depth to 10

In NorthAmericanCultureMt ask:

        (#$intersectsIntervalType #$CalendarWinter #$NewYearsDay)

The bindings found should be (((T.T))).

Examine #$NewYearsDay, and view the arguments for any newly concluded assertions.

- Note that some of the steps in the inference path are assertions, and some are the results of HL modules.
- Note that the argument order in the resulting assertion is the reverse of the formula that was originally asked. This is because #$intersectsIntervalType is symmetric.

Now try the ASK in BaseKB, NorthernHemisphereMt, and WesternCultureMt.

Did you get an answer?

Now ask if NewYearsDay is a LegalHoliday in BaseKB; in NorthAmericanCultureMt:

        (#$genls #$NewYearsDay #$LegalHoliday)

If we create AustralianLifeMt, which existing Mts would be its genlMts? What other Mts would we want to add as its genlMts? Which assertions should hold true of NewYearsDay in AustralianLifeMt?

If we create ArabianPeninsulaLifeMt, which existing Mts would be its genlMts? What other Mts would we want to add as its genlMts? Which assertions should hold true of NewYearsDay in ArabianPeninsulaLifeMt?

Go to Top