Logo 
Search:

Artificial Intelligence Articles

Submit Article
Home » Articles » Artificial Intelligence » ProLogRSS Feeds

ProLog Program of teacher and lecture

Posted By: Milind Mishra     Category: Artificial Intelligence     Views: 12300

Program of teacher and lecture......

Code for ProLog Program of teacher and lecture in Artificial Intelligence

trace
domains
    sublist = symbol*

database
    teachers(symbol,sublist)
    lectures(symbol,integer)

predicates
    find_no_lect(symbol)
    initialize()
    find_sub(sublist,integer,integer)
    display1(symbol,integer)
    go
goal
    go.

clauses

    go :-
        initialize(),
        find_no_lect("bt").

    initialize() :-
        assert(teachers("bt",[cpp,nt1,nt2])),
        assert(teachers("ba",[cobol,dfs,consm])),
        assert(teachers("harshal",[c,conm,ss])),

        assert(lectures("cpp",10)),
        assert(lectures("nt1",10)),
        assert(lectures("nt2",5)),
        assert(lectures("cobol",15)),
        assert(lectures("dfs",10)),
        assert(lectures("consm",9)),
        assert(lectures("c",2)),
        assert(lectures("conm",20)),
        assert(lectures("ss",15)).

    find_no_lect(N) :-
        teachers(N,S_LIST),
        find_sub(S_LIST,0,0).


    find_sub([H|T],CNT,NO2) :-
        
        TMPLIST = [H|T],
        CNT1 = CNT + 1,
        lectures(H,NO1),
        NO = NO2 + NO1,
        display1(H,NO),
        find_sub(T,CNT1,NO).
        
    display1(S,N) :- 
        write(S), write(" "), write(N),nl.
  
Share: 


Didn't find what you were looking for? Find more on ProLog Program of teacher and lecture Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of ProLog Program of teacher and lecture is from India.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!