# Teaching

### Site Tools

epgy:ai13:assignment_11

# Assignment 11

## Lab 0 - Consider a different Appearance Theme for your Blog

Go and look at 5 other blogs from this class. Use them as a reference to make yours look better.

## Lab 1 - Prolog

In section 1.1 you can launch a Prolog interpreter applet by hitting the button.

```mortal(M) :- man(M).
man(socrates).```

In the Program window, paste the above in. Then in the Query box at the top, ask it whether socrates was mortal. Remember lower case means constant, upper case means variable.

` mortal(socrates). `

(Deliverable) Now, write a program about how the dining hall only has chocolate soft serve icecream and not vanilla. When I ask for what flavors are there, it tells me no there is no vanilla, but yes there is chocolate.

Put the code in Setting Up Pastebin or just save it somewhere (I want both this lab and the next to be in one blogpost).

More prolog programs:

## Lab 2 - Answer Set Programming

Here's the ASP Solver:

Take a look at this program. Paste it into the big window. Click the Solve button.

```sibling(X,Y) :- parent(Z,X), parent(Z,Y).
mother(X,Y) :- parent(X,Y), female(X).
uncle(X,Y) :- parent(Z, Y), sibling(Z,X), male(X).
female(joan). female(jill). male(jack).
parent(joan, jack). parent(joan, jill). ```

(Deliverable) Next, take that program above and use it to represent your own family.

If you are still interested, try playing around with the Event Calculas code. Remember, it's like inertia– it stays true if it is true.

```#const t_max=8.
t(0..t_max).

#domain fluent(F).
#domain t(T).
#domain event(E).

initiated(F,T) :-
happens(E,T),
initiates(E,F,T).

terminated(F,T) :-
happens(E,T),
terminates(E,F,T).

holds(F,T+1) :-
holds(F,T),
not terminated(F,T).

-holds(F,T+1) :-
-holds(F,T),
not initiated(F,T).

holds(F,T+1) :-
initiated(F,T).

-holds(F,T+1) :-
terminated(F,T).

holds(F,0) :- initially(F).
-holds(F,0) :- not initially(F).

initially(hot).
fluent(hot).```

For lparse arguments in the text box below, you must pass in:

`--true-negation`

Now, create an event using “happens(E,T)” that terminates the heat.

(Deliverable) Paste it all in Setting Up Pastebin as a prolog program and put it in a blogpost. Make sure you store your output somewhere on your blogpost as well.

Write about how you understand time in logic programming. Explain how in logic programming time happens all at once.

## Work on your Final Projects!

Put your final presentations in the presentation folder I shared on Google Drive.

'nuff said.