70 likes | 155 Views
Semantics of FO Formulas. Semantics. Given a vocabulary R 1 , …, R k A model is D = (D, R 1 D , …, R k D ) D = a set, called domain, or universe R i D D D ... D, (ar(R i ) times) i = 1,...,k. Semantics. Given: A model D = (D, R 1 D , ..., R k D ) A formula
E N D
Semantics • Given a vocabulary R1, …, Rk • A model is D = (D, R1D, …, RkD) • D = a set, called domain, or universe • RiD D D ... D, (ar(Ri) times) i = 1,...,k
Semantics • Given: • A model D = (D, R1D, ..., RkD) • A formula • A substitution s : {x1, x2, ...} D • We define next the relation:meaning “D satisfies with s” D |= [s]
Semantics If (s(t1), ..., s(tn)) RD D |= (R(t1, ..., tn)) [s] D |= (t= t’) [s] If s(t) = s(t’)
Semantics D |= ( ’) [s] If D |= ()[s] and D |= (’) [s] D |= ( ’) [s] If D |= ()[s] or D |= (’) [s] D |= (’) [s] If not D |= ()[s]
First Order Logic: Semantics If for all s’ s.t. s(y) = s’(y) for all variables y other than x, D |= ()[s’] D |= (x.) [s] D |= (x.) [s] If for some s’ s.t. s(y) = s’(y) for all variables y other than x, D |= ()[s’]
FO and Databases • FO:a sentence is true in D if D |= • Databases:a formula with free variables x1, ..., xn defines the query:(D) = {(s(x1), ..., s(xn)) | D |= [s]}