1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science...

17
1/31/01 Professor Richard Fikes Frame Representation Frame Representation of Electronic of Electronic Circuit Example Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge Systems Laboratory, Stanford Universi

Transcript of 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science...

Page 1: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

1/31/01

Professor Richard Fikes

Frame RepresentationFrame Representationof Electronic Circuit of Electronic Circuit

ExampleExample

Computer Science DepartmentStanford University

CS222Winter 2001

Knowledge Systems Laboratory, Stanford University

Page 2: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

2

Thing and ClassThing and ClassThing

Documentation: “The class of all objects.” Instance-Of: Class Subclass-Of: Thing

Slot-Cardinality: 1Value-Type: Class

*Instance-Of:Minimum-Slot-Cardinality: 1Value-Type: Class

*Documentation:Value-Type: String

Class Documentation: “The class of all classes.” Subclass-Of: Thing*Subclass-Of:

Minimum-Slot-Cardinality: 1Value-Type: Class

------------------------------------(Thing ?x)

Page 3: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

3

Electrical ComponentElectrical Component

Electrical-Component Subclass-Of: Thing

Instance-Of: Class

*Component-Of:Maximum-Slot-Cardinality: 1

Value-Type: Electrical-Component

*Component:Value-Type: Electrical-Component

Inverse: Component-Of

Page 4: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

4

CircuitCircuit

Circuit Instance-Of: Class Subclass-Of: Electrical-Component*Input:

Minimum-Slot-Cardinality: 1Value-Type: TerminalSubset-Of-Values: Component

*Output:Minimum-Slot-Cardinality: 1Value-Type: TerminalSubset-Of-Values: Component

*Gate:Value-Type: GateSubset-Of-Values: Component

Page 5: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

5

TerminalTerminal

Terminal Instance-Of: Class Subclass-Of: Electrical-Component*Signal:

Slot-Cardinality: 1Value-Type: (listof On Off)Same-Values: (listof Connected-To Signal)

*Connected-To:Value-Type: TerminalInverse: Connected-To

Page 6: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

6

GateGate

Gate Instance-Of: Class Subclass-Of: Electrical-Component*Type:

Slot-Cardinality: 1Value-Type: (listof And Or Xor Not)

*Input:Minimum-Slot-Cardinality: 1Value-Type: TerminalSubset-Of-Values: Component

*Output:Minimum-Slot-Cardinality: 1Value-Type: TerminalSubset-Of-Values: Component

Page 7: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

7

Two-To-One GateTwo-To-One GateTwo-To-One-Gate

Subclass-Of: Gate*Input:

Slot-Cardinality: 2

*Output:Slot-Cardinality: 1

*Input1:Slot-Cardinality: 1Value-Type: TerminalSubset-Of-Values: Input

*Input2:Slot-Cardinality: 1Value-Type: TerminalSubset-Of-Values: Input

Page 8: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

8

And GateAnd GateAnd-Gate

Subclass-Of: Two-To-One-Gate*Type: And

Or-Gate Subclass-Of: Two-To-One-Gate*Type: Or

----------------------------------------- (=> (And-Gate ?g) (<=> (Signal (Output ?g) On) (and (Signal (Input1 ?g) On) (Signal (Input2 ?g) On)))) (=> (Or-Gate ?g) (<=> (Signal (Output ?g) On) (or (Signal (Input1 ?g) On) (Signal (Input2 ?g) On))))

Page 9: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

9

Xor GateXor Gate

Xor-Gate Subclass-Of: Two-To-One-Gate*Type: Xor

-----------------------------------------(=> (Xor-Gate ?g)

(<=> (Signal (Output ?g) On)

(or (and (Signal (Input1 ?g) On)

(Signal (Input2 ?g) Off))

(and (Signal (Input1 ?g) Off)

(Signal (Input2 ?g) On)))))

Page 10: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

10

Not GateNot GateNot-Gate

Subclass-Of: Gate*Type: Not *Input:

Slot-Cardinality: 1

*Output:Slot-Cardinality: 1

-------------------------(=> (Not-Gate ?g)

(and (=> (Signal (Input ?g) Off)

(Signal (Output ?g) On))

(=> (Signal (Input ?g) On)

(Signal (Output ?g) Off))))

Page 11: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

11

Digital Circuit CDigital Circuit C11

Russell and Norvig, Figure 8.1

Sum Out

Carry Out

AddendsIn

Carry In

Page 12: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

12

Frame Representation of CFrame Representation of C11

C1Instance-Of: CircuitInput: C1-Addend1 C1-Addend2 C1-Carry-InOutput: C1-Sum C1-Carry-OutGate: X1 X2 A1 A2 O1

X1Instance-Of: Xor-GateInput1: X1-Input1Input2: X1-Input2Output: X1-Output

X1-Input1Instance-Of: TerminalConnected-To: C1-Addend1

...

Page 13: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

13

Frame Language InferencesFrame Language InferencesC1

Instance-Of: CircuitInput: C1-Addend1 C1-Addend2 C1-Carry-InOutput: C1-Sum C1-Carry-OutGate: X1 X2 A1 A2 O1Component: C1-Addend1 C1-Addend2 C1-Carry-In C1-Sum

C1-Carry-Out X1 X2 A1 A2 O1X1

Instance-Of: Xor-GateInput1: X1-Input1Input2: X1-Input2Output: X1-OutputInput: X1-Input1 X1-Input2Component: X1-Input1 X1-Input2 X1-OutputComponent-Of: C1

X1-Input1Instance-Of: TerminalConnected-To: C1-Addend1Component-Of: X1...

Page 14: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

14

One Bit Adder as a ClassOne Bit Adder as a ClassOne-Bit-Adder

Subclass-Of: Circuit*Addend1:

Slot-Cardinality: 1Value-Type: One-Bit-Adder-Addend1Subset-Of-Values: Input

…*Input:

Slot-Cardinality: 3*Sum:

Slot-Cardinality: 1Value-Type: One-Bit-Adder-SumSubset-Of-Values: Output

…*Output:

Slot-Cardinality: 2*X1:

Slot-Cardinality: 1Value-Type: One-Bit-Adder-X1Subset-Of-Values: Gate

…*Gate:

Slot-Cardinality: 5

Page 15: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

15

One-Bit-Adder ComponentsOne-Bit-Adder Components

One-Bit-Adder-Addend1 Subclass-Of: Terminal*Connected-To:

Same-Values: (listof Component-Of X1 Input1)

One-Bit-Adder-X1 Subclass-Of: Xor-Gate*Input1:

Value-Type: One-Bit-Adder-X1-Input1

...

One-Bit-Adder-X1-Input1 Subclass-Of: Terminal*Connected-To:

Same-Values: (listof Component-Of Component-Of Addend1)

Page 16: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

16

CC11 As An Instance Of One-Bit-Adder As An Instance Of One-Bit-Adder

C1Instance-Of: One-Bit-Adder

Addend1: C1-Addend1

...

Sum: C1-Sum

X1: C1-X1

Component: C1-Addend1 … C1-Sum … C1-X1 …

Input: C1-Addend1 C1-Addend2 C1-Carry-In

Output: C1-Sum C1-Carry-Out

Page 17: 1/31/01 Professor Richard Fikes Frame Representation of Electronic Circuit Example Computer Science Department Stanford University CS222 Winter 2001 Knowledge.

Knowledge Systems Laboratory, Stanford University

17

Inferred CInferred C11 Components Components

C1-Addend1Instance-Of: One-Bit-Adder-Addend1Component-Of: C1Connected-To: C1-X1-Input1

C1-X1Instance-Of: One-Bit-Adder-X1Component-Of: C1Input1: C1-X1-Input1...

C1-X1-Input1Instance-Of: One-Bit-Adder-X1-Input1Component-Of: C1-X1Connected-To: C1-Addend1...