Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

DT249-1 Semester 2 Assignments

Options
  • 18-03-2009 4:00pm
    #1
    Closed Accounts Posts: 2,696 ✭✭✭


    Thread for assistance with assignments, anyone in DT249-1 is welcome to request assistance here for assignments. Anyone outside or inside class is welcome to assist with solutions.

    I am progressing well with XML assignment and can possibly assist in that department.

    For CafeObj I cannot load modules, I save the file wth .mod extension in the lib folder but cannot open module from command line - need Help!!!


«1

Comments

  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    What syntax do I enter for dress and hat = true

    mod* DRESS-HAT {
    pr(PROPC)
    -- Note the symbol for implies in PROPC is ->
    -- This is the same symbol that CafeOBJ
    -- uses for the return value of a function.
    -- The context should keep their meanings distinct.
    op picture : Prop Prop  -> Prop
    vars hat dress : Prop
    eq [P1] : picture(dress,hat) =  
    
    }
    


  • Registered Users Posts: 375 ✭✭babyhack


    I just cant get this CafeOBJ stuff
    just when I think I am getting somewhere I get lost again

    You have any luck getting it

    BH


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    I think so.. code now below I think is correct, as from the picture, if the dress is being worn then so is the hat - so dress is true implies hat is also true


    mod* DRESS-HAT {
    pr(PROPC)
    -- Note the symbol for implies in PROPC is ->
    -- This is the same symbol that CafeOBJ
    -- uses for the return value of a function.
    -- The context should keep their meanings distinct.
    op picture : Prop Prop  -> Prop
    vars hat dress : Prop
    eq [P1] : picture(dress,hat) =  dress -> hat .
    }
    


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    Having a problem with code syntax below - there is an implicit and between axioms, so if my total goes over 500 it still picked up discount from > 100 - so i guess something like
    ceq discount(p) = 5 if p > 100 & < 499 .

    module! BILL {
    pr (INT)
    op bill : Int Int -> Int
    op discount :  Int  -> Int
    vars p q r : Int
    ceq discount(p) = 0 if p < 100 .
    ceq discount(p) = 5 if p > 100 .
    ceq discount(p) = 50 if p > 500 .
    
    -- Two more equations required to compute discount
    eq bill(p,q) = p * q - discount(p * q) .
    }
    


  • Registered Users Posts: 375 ✭✭babyhack


    ok I have this for DRESS-HAT
    mod* DRESS-HAT {
    pr(PROPC)
    -- Note the symbol for implies in PROPC is ->
    -- This is the same symbol that CafeOBJ
    -- uses for the return value of a function.
    -- The context should keep their meanings distinct.
    
    op picture : Prop Prop  -> Prop
    
    vars hat dress : Prop
    eq [P1] : picture(dress,hat) = dress -> hat .
    eq [P2] : picture(dress,not(hat)) = dress -> not(hat) .
    eg [p3] : picture(not(dress),hat) = not(dress) -> hat .
    eq [p4] : picture(not(dress),not(hat) = not(dress) -> not(hat) .
    }
    

    and this for bill
    module! BILL {
    pr (INT)
    
    op bill : Int Int -> Int
    op discount :  Int  -> Int
    vars p q r : Int
    
    ceq discount(p) = 0 if p < 100 .
    -- Two more equations required to compute discount
    ceq discount(p) = 5 if p >= 100 ^ <= 500 .
    ceq discount(p) = 50 if p > 500 .
    
    eq bill(p,q) = p * q - discount(p * q) .
    }
    

    Seem to be close to what you have maybe we are starting to get it
    Still dont know if we have it right or not
    BH


  • Advertisement
  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    for dress - I thought only one line was required, I have emailed Pat and asked.

    for P2 - this one contradicts P1
    P1 having dress on implies that the hat is being worn
    P2 having dress in implies hat is not being worn

    I hate CafeObj!!

    And I do feel it for Art, the subject isnt great, its really for Project Management and I ve no interest in that part of systems. Fair play to him "deadlines mean nothing to part time students", my assignment should be in before Christmas :)


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    module! BILL {
    pr (INT)
    op bill : Int Int -> Int
    op discount :  Int  -> Int
    vars p q r : Int
    ceq discount(p) = 0 if p < 100 .
    ceq discount(p) = 5 if (p >= 100) and  (p <= 499) .
    ceq discount(p) = 50 if p >= 500 .
    
    -- Two more equations required to compute discount
    
    eq bill(p,q) = p * q - discount(p * q) .
    }
    

    This now seems perfect for BILL - i didnt think "and" could be entered into RHS


  • Registered Users Posts: 1,512 ✭✭✭stevire


    babyhack wrote: »
    on a side note Arts class tonight god can that man woffle about crap, I dont think he knows whats he is talking about himself half the time, thank god for online notes
    john47832 wrote: »
    And I do feel it for Art, the subject isnt great, its really for Project Management and I ve no interest in that part of systems. Fair play to him "deadlines mean nothing to part time students", my assignment should be in before Christmas :)

    Ye do know a lot of the lectures are active members on boards?? I don't think its fair to berate them publicly... Yer comments could come back to haunt ye, personally I hope it does!!

    It really grinds my gears to see students come on here and start berating lecturers, if ye have a problem go say it to them or the students union. Just because they're not up to yer teaching "standards".

    I'll be first to admit there is the odd few lecturers that are hard to understand. But if i have a problem I go sort it out, not berate them publicly.


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    stevire wrote: »
    Ye do know a lot of the lectures are active members on boards?? I don't think its fair to berate them publicly... Yer comments could come back to haunt ye, personally I hope it does!!

    It really grinds my gears to see students come on here and start berating lecturers, if ye have a problem go say it to them or the students union. Just because they're not up to yer teaching "standards".

    I'll be first to admit there is the odd few lecturers that are hard to understand. But if i have a problem I go sort it out, not berate them publicly.

    Do you know back seat modding is an offence on boards???


  • Registered Users Posts: 375 ✭✭babyhack


    stevire wrote: »
    Ye do know a lot of the lectures are active members on boards?? I don't think its fair to berate them publicly... Yer comments could come back to haunt ye, personally I hope it does!!

    It really grinds my gears to see students come on here and start berating lecturers, if ye have a problem go say it to them or the students union. Just because they're not up to yer teaching "standards".

    I'll be first to admit there is the odd few lecturers that are hard to understand. But if i have a problem I go sort it out, not berate them publicly.

    I never said I did not like the man (his online notes are great and could not do without them)
    Sometimes (and this is no ones fault) 2 hours of solid talking is not going to help lecturer or student
    90% of DT249 are comming straight from a fulltime job to class and sitting for 2 hours listening to someone (reguardless of how good they are) is not good

    I like Art, I understand he has a long day too and he has been very kind in giving us extra time to do the project

    Anyany this is going way off topic

    BH


  • Advertisement
  • Registered Users Posts: 1,512 ✭✭✭stevire


    john47832 wrote: »
    Do you know back seat modding is an offence on boards???

    You do know boards is a PUBLIC forum. Hence I'm entitled to my opinions. Back seat modding with be along the lines if I suggest ye should get bans or edit posts.

    It's just I think these sly comments and berating are becoming more regular in the DIT forum, not exactly giving a great name to the college. Especially when all the comments are biased and we never get the other side of the argument.

    Just my 2c.


  • Registered Users Posts: 9 Maximo


    If your opinion was needed we would of asked.We didnt so ya know what to do.We are trying to trying to help one another out here, so please leave us alone to do this. Thanks


  • Registered Users Posts: 6 krikuletz


    Rite, so lads... let's focus again on the assignments :)

    I've handled in already tuesday's 1, now i shall hope to finish this for 2day.
    For the tuesday's one, you can get help by checkin on google ebooks,good luck with that.

    How did you get on with XML, i don't think is that hard if u check w3schools.com. U kinda need some time but in the end it will pay off.

    It might be too late to ask this...but any idea on Q3(ii/iii) on today's assignmnt ?

    Cheers,

    F.


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    This is what I have but cannot make head nor tail of the proof

    mod! JOE{
    protecting(BOOL)
     pred s : -- Joe submits a project in CS414
    pred f : -- Joe fails CS414
    pred g : -- Joe graduates
    
    ax [F0] : ~(s) -> f .
    ax [F1] : f -> ~(g) .
    ax [F2] : g -> s .
    }
    


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    Can anyone help me to explain my proof
    ** PROOF ________________________________
      1:[] s | f
      4:[] ~(s)
      5:[] ~(f)
      7:[neg-hyper:5,1,4]
    ** ______________________________________
    


  • Registered Users Posts: 6 krikuletz


    John, thanks a mil for that! I will look into it from here and hopefully i'll get the tail and head myself.

    Many Thanks again.

    F.
    john47832 wrote: »
    This is what I have but cannot make head nor tail of the proof

    mod! JOE{
    protecting(BOOL)
     pred s : -- Joe submits a project in CS414
    pred f : -- Joe fails CS414
    pred g : -- Joe graduates
    
    ax [F0] : ~(s) -> f .
    ax [F1] : f -> ~(g) .
    ax [F2] : g -> s .
    }
    


  • Registered Users Posts: 375 ✭✭babyhack


    john47832 wrote: »
    Can anyone help me to explain my proof
    ** PROOF ________________________________
      1:[] s | f
      4:[] ~(s)
      5:[] ~(f)
      7:[neg-hyper:5,1,4]
    ** ______________________________________
    

    Explain each line the CaféOBJ output under the "** PROOF" section.
    1:[] s | f
    4:[] ~(s)
    5:[] ~(f)
    6:[neg-hyper:5,1,4] 
    
    Line 1 says that s(submited) or f(failed) have to be true
    Line 4 establishes ~(s) (not(submited))
    Line 5 establishes ~(f) (not(failed)
    Line 6 cancels lines 5, 1 and 4 giving the empty place
    Line 6 establishes a contradiction
    

    Thats what I have

    BH


  • Registered Users Posts: 6 krikuletz


    Lads,

    I have gone through this Q1(iv):
    mod* DRESS-HAT {
    pr(PROPC)
    -- Note the symbol for implies in PROPC is ->
    -- This is the same symbol that CafeOBJ
    -- uses for the return value of a function.
    -- The context should keep their meanings distinct.

    op picture : Prop Prop -> Prop

    vars hat dress : Prop
    eq [P1] : picture(dress,hat) = dress -> hat .
    eq [P2] : picture(dress,not(hat)) = dress -> not(hat) .
    eg [p3] : picture(not(dress),hat) = not(dress) -> hat .
    eq [p4] : picture(not(dress),not(hat) = not(dress) -> not(hat) .
    }

    However it gives me an error when im using " in xxxx.mod" it says that eq [p3] has something wrong in it. Would you have any ideas?

    Id love to help on the other subjects but im quite a newbie on this module.I could however help on the other 2 if required.

    Many thanks in advance.

    Regards,
    F.


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    Makes sense - thanks BH


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    Complete the equation labelled P1in the DRESS-HAT module

    Does this mean just "complete the 1 equation"

    The only logical information we are given is that if the Dress is being worn then the Hat is also being worn - no other information is given


  • Advertisement
  • Registered Users Posts: 6 krikuletz


    Therefore you're saying that the answer to the Q1(iii) is only A ? which in fact makes Q(iv) much easier.
    john47832 wrote: »
    Complete the equation labelled P1in the DRESS-HAT module

    Does this mean just "complete the 1 equation"

    The only logical information we are given is that if the Dress is being worn then the Hat is also being worn - no other information is given


  • Registered Users Posts: 375 ✭✭babyhack


    Can someone let me know how to run a test from Q2
    Its the only bit i dont have done
    Thanks
    BH
    Q2(ii) Run the bill(p,q) function on three sample inputs.
    Run three tests to ensure that the discount(p)function is working correctly.
    Q2(ii) Solution
    


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    red bill(10,5)

    calculation done is 10 * 5 = 50 - should return 50 as no discount for below 100

    red bill(10,20)

    calculation done is 10 * 20 = 200 - should return 195 as 5 discount is applied for above 100 and less than 500


    red bill(10,60)

    calculation done is 10 * 60 = 600 - should return 550 as 50 discount is applied for above 500


  • Registered Users Posts: 375 ✭✭babyhack


    john47832 wrote: »
    red bill(10,5)

    calculation done is 10 * 5 = 50 - should return 50 as no discount for below 100

    red bill(10,20)

    calculation done is 10 * 20 = 200 - should return 195 as 5 discount is applied for above 100 and less than 500


    red bill(10,60)

    calculation done is 10 * 60 = 600 - should return 550 as 50 discount is applied for above 500

    Thanks man

    BH


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    Is there an Information Systems class this evening? There is none scheduled on Ciarans class page


  • Registered Users Posts: 187 ✭✭Murilloinf


    does anybody have the exams timetables ?


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    Only a B in Computing Fundamentals assignment - thought I would ave got higher :(


  • Closed Accounts Posts: 2,696 ✭✭✭mark renton


    FFS I'm not happy :mad: another assignment 3 weeks before exams

    I can even remember how to run a new module :o - what is the syntax to run a new module in CafeObj ??


  • Registered Users Posts: 375 ✭✭babyhack


    john47832 wrote: »
    FFS I'm not happy :mad: another assignment 3 weeks before exams

    I can even remember how to run a new module :o - what is the syntax to run a new module in CafeObj ??

    Have this really funny feeling that the assignment may just be whats on the exam or be very very close to it

    BH


  • Advertisement
  • Registered Users Posts: 9 Maximo


    I was thinking/Hoping this is the case otherwise Im f*****. I understand Klingon better than this stuff!


Advertisement