applications n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Applications PowerPoint Presentation
Download Presentation
Applications

Loading in 2 Seconds...

play fullscreen
1 / 31

Applications - PowerPoint PPT Presentation


  • 70 Views
  • Uploaded on

Applications. t.k.prasad@wright.edu http://www.knoesis.org/tkprasad/. VHDL-Parser Pretty-Printer System. t.k.prasad@wright.edu http://www.knoesis.org/tkprasad/. URLs. Online Parser Documentation http://www.cs.wright.edu/~tkprasad/VHDL/VHDL-AMS/START.html Public Distribution

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Applications' - taini


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
applications

Applications

t.k.prasad@wright.edu

http://www.knoesis.org/tkprasad/

L13Applications

vhdl parser pretty printer system

VHDL-Parser Pretty-Printer System

t.k.prasad@wright.edu

http://www.knoesis.org/tkprasad/

L13Applications

slide3
URLs
  • Online Parser Documentation
    • http://www.cs.wright.edu/~tkprasad/VHDL/VHDL-AMS/START.html
  • Public Distribution
    • http://www.cs.wright.edu/~tkprasad/VHDL/VHDL-AMS.zip

L13Applications

a meta interpreter for circuit extraction

A Meta-Interpreter for circuit Extraction

t.k.prasad@wright.edu

http://www.knoesis.org/tkprasad/

L13Applications

outline
Outline
  • Formal Description of Digital Circuits
  • Design Verification
  • Motivation for Applying Meta-programming Techniques
  • Implementation and Correctness Considerations
  • Conclusions

L13Applications

hierarchical description of circuit design
Hierarchical Description of Circuit Design

Full-Adder

Half-Adder

Sub-Components

Abstraction

AND-OR-NAND

Gates

Gate-level Description

CMOS Transistors

Transistor Netlist

Component

L13Applications

declarative specification of the structure inverter and netlist
Declarative Specification of the Structure: Inverter and Netlist

Single Inverter:

inv(In,Out,X,Y) :-

pt(In,vdd,Out,X,Y),

nt(In,gnd,Out,_,_).

Netlist:

pt(in1,vdd,out1,50,50).

nt(in1,gnd,out1,50,40).

pt(out1,vdd,out2,100,50).

nt(out1,gnd,out2,100,40).

GND

L13Applications

problem and solution strategy
Problem and Solution Strategy
  • Verify structural correctness of a component layout by reverse engineering the top-level design.
  • Use automatically generated Prolog extraction rules
    • Prolog specifications are executable and can be used to simulate the circuit or check for faults by designing suitable queries

L13Applications

circuit extraction
Circuit Extraction

MAGIC (CAD Tool) Layout

TRANSLATE

Netlist : Prolog Facts

EXTRACT

Higher-level Components

L13Applications

extraction rules in prolog
Extraction Rules in Prolog

extract_inverter :-

pt(In,vdd,Out,X,Y),

nt(In,gnd,Out,_,_),

remove_pt(In,vdd,Out),

remove_nt(In,gnd,Out),

asserta(inverter(In,Out,X,Y)).

L13Applications

finer points
Finer Points
  • Retracts not undone on backtracking =>

Identify complete component before retracting

  • Retract all occurrences of a component =>

Use “fail” appropriately.

L13Applications

spec vs extraction template
Spec vs Extraction Template

component :-

subcomponent_1

subcomponent_2.

extract_component :-

subcomponent_1

subcomponent_2,

retract(subcomponent_1),

retract(subcomponent_2),

assert(component),

fail.

L13Applications

problem and our solution
Problem and Our Solution
  • Requires generation of customized extraction rules (for each component) explicitly (which causes duplication of information).
  • Use meta-programming techniques to perform extraction “on-the-fly” using declarative specification of the structure of the component.

L13Applications

slide14

Advantage: Avoids explicit creation and storing of extraction rules

  • Disadvantage: Meta-interpretation is slower than using customized extraction rules
  • Pragmatically: Explicit rules are good for extracting low-level components, while meta-interpreter is good for extracting high-level component extraction

L13Applications

meta rule
Meta-Rule

extract(Comp) :-

clause(Comp, Sub_Comps),

Sub_Comps \== true,

call(Sub_Comps),

remove_primitive(Sub_Comps),

asserta(Comp), fail.

extract(_).

L13Applications

slide16

remove_primitive((C1,C2)) :-

!, remove_primitive(C1),

remove_primitive(C2).

remove_primitive(C) :-

clause(C,true), !, retract(C).

remove_primitive(C) :-

clause(Comp,Sub_Comps),

remove_primitive(Sub_Comps).

L13Applications

cont d
(cont’d)
  • The interpreter does not work properly if the definition also contains ordinary predicates, written to capture connectivity constraints, position calculations, etc.
  • Introduce special meta-predicate constraint as follows:

constraint(Test) : - call(Test).

remove_primitive(constraint(_)):-!.

L13Applications

example
Example

invZ(P,N,I,O,X,Y) :-

pt(I,vdd,Q,X1,Y1), pt(P,Q,O,X2,Y2),

nt(N,O,R,X3,Y3), nt(I,R,gnd,X4,Y4),

constraint( \+

connected([Q,R,vdd,gnd])

),

constraint( X is (X1+X2+X3+X4)/4, Y is (Y1+Y2+Y3+Y4)/4

).

L13Applications

correctness issue
Correctness Issue
  • Facts and rule-heads are disjoint. The lowest-level is represented as facts. Retraction of facts is sufficient.
  • Each fact contributes to just one rule. Subcomponents are not shared.

Retraction of a fact does not interfere with the extraction of other components.

(Stratification of sorts)

L13Applications

conclusion
Conclusion
  • Meta-interpreter approach uses the declarative specification of a design directly, to perform extraction.
  • This approach is flexible, for higher-level components. The trade-off is that it is inefficient for lower-level components.

L13Applications

meta interpreters

Meta-Interpreters

Ref: Yoav Shoham’s AI Techniques in Prolog

L13Applications

slide22
Types

Extensions

Expert systems

Mycin

Abductive Reasoning

Diagnosis

Annotated Logic Programming

  • Backward Chaining (Top-down)
    • Depth-first
      • Prolog
    • Breadth-first
  • Forward Chaining (Bottom-up)
      • Production Systems

L13Applications

representing forward chaining rules
Representing forward chaining rules

op(1000, xfy, ‘,’).

op(1150, xfx, ‘-:’).

p -: q.

r,s -: p.

q -: t.

  • Forward chaining adds new conclusions using rules in response to facts of the database and the newly asserted conclusions.

L13Applications

membership in and list
Membership in and-list

amember(X, (A,B)) :-

!, ( X = A; amember(X,B)).

amember(A,A).

  • Recall

op(_, xfy, ‘,’).

L13Applications

propagating the effect of facts
Propagating the effect of facts
  • Forward chaining interpreter recursively determines the conclusions forced by the facts and the rules, and asserts them explicitly.
    • Given the set of rules, each fact is asserted one by one (using the code shown on the next slide) and the conclusions implied by them are determined.
      • Specifically, the head of a rule is asserted after all the literals in the body of the rule have been asserted.

L13Applications

propagating the effects of facts
Propagating the effects of facts

update(X) :- clause(X, true),!.

update(X) :-

assert(X),

( If -: Then ),

amember(X, If),

\+((amember(Y, If),

\+(clause(Y, true)))),

update(Then), fail.

L13Applications

propagating the effect of facts1
Propagating the effect of facts
  • Complexity of update()
      • O( number of rules * number of body literals)
  • Can be optimized and extended to include negative literals, deletion, and maintaining justifications.
  • Reference: Chapter 4 of YoavShoham’s AI Techniques in Prolog

L13Applications

pooling of evidence the mycin approach

Pooling of Evidence : The Mycin approach

Ref: Yoav Shoham’s AI Techniques in Prolog

L13Applications

introducing certainty factor
Introducing Certainty Factor
  • Facts => CF = 1
  • Rules => CF in [0,1]

high_fever. (1)

malaria :- high_fever, recently_in_jungle. (0.8)

malaria :- …

L13Applications

mycin interpreter
Mycin Interpreter

cert(true, 1).

cert( (A,B), C) :- !,

cert(A , C1), cert(B, C2),

comb_fn_serial(C1, C2, C).

cert( A, C) :- !,

findall(CC,

(clause(A,B,CF),

cert(B , CC)), CLst),

comb_fn_parallel(CLst, C).

L13Applications

other static analysis tools
Other Static Analysis Tools
  • Type Checking/Inference

append(list(X), list(X), list(X)).

fact(int, int).

  • Mode Inference

append(+,+,_)

L13Applications