Think about your final project! Pick a different partner than for case-studies. Write a project proposal for TAs + Tim to review, due 3/23. Pick an interesting system to that you can learn something about by modeling.
sig Thing {}
one sig MySeq {
s: seq Thing,
stuff: seq Thing, // default: one
apair: one Thing -> Thing // default: set, won't work: need a 'fact'
}
run Test {
some x,y: MySeq.s |
x != y
} for 1 Thing
s
has 3 columns, so MySeq.s
has 2. Turns out MySeq.s
is actually a set: default multiplicity when there's more than
one column, is set. Make sure that every time you quantify over something, the thing you're quantifying over
has only one column. In Seqs
: quantify over elems
or inds
.
run Test {
some x,y: MySeq.s.elems |
x != y
} for 1 Thing
Last time: SAT solving. DPLL algorithm, pick randomly, propagate units, end up with a set of variables that make make an instance true. Soundness: if we find an instance, it will be true Completeness: if a solution exists we will find it
Today: want to figure out if something is satisfiable by why of find a proof of unsatisfiability. Think about it like we're moving from alloy instances to alloy cores. Sat or not? What is the proof that it's unsat? Something better than just checking all instances.
(x1 or x2)
(not x1 or not x2)
(not x1 or x2)
(x1 or not x2)
"Tim likes cookies"
"Somebody who likes cookies has good taste"
What can we infer? What does 'somebody' mean? Try again:
C: "Tim likes cookies"
G: "If Tim likes cookies, Time has good taste"
C and (C => G)
C and (not C or G)
Modos ponens: a rule of inference, rule of deduction. Keep applying it to increase your knowledge base. a, a => b means we can conclude b
Soundness: everything we derive is valid consequence of our knowledge base
Completeness: if something is entailed by your knowledge, you will eventually derive it
Unsound:
b, a => b means we can conclude a
If somebody is a Brown student, then they're awesome
a: person is a Brown student
b: person is awesome
Is every awesome person always a Brown student?
A logical fallacy. What can it derive for us? It can derive that any awesome
person is a Brown student, but these are invalid deductions
Is completeness a desirable property?
a => a or b
Tim likes cookies => Tim likes cookies or Tim likes spinach
Anything substituted for b valid, but maybe not relevant. Our sets of axioms don't need to be entirely complete.
"All students like either kebab or cookies"
"Emma like cookies"
"If someone likes either kebab or cookies, they have good taste"
implies: "Emma has good taste"
Can we derive this using only modos ponens? Yes. But, modos ponens can't be used for everything.
What is the expressive power of your language?