I have the following relation: R = (ABCDE) with the functional dependencies F = {A → B, B → CDE, E → AC}. The two decompositions I have are R1 = (BCDE) and R2 = (AE). How do I check whether or not these decompositions are in BCNF? I know how to check if they're lossless and dependency preserving (in this case I think both answers are yes), not how to check if they're in BCNF.
Assuming that F is a cover of the functional dependencies of R, the relation is already in BCNF.
In fact, to check that a relation is BCNF, we can check if all the dependecies of a cover have the determinant which is a superkey. In your case this is true (since the candidate keys of the relation are A, B, and E), so there is no need to decompose it.
Related
Is there already some term equality relation defined in Isabelle? What is the broadest set of terms on which it is defined?
Just to be clear, I'm looking for a relation a ~ b that returns True iff a is b in the sense that they look exactly the same written down: no properties of a and b should need to be known to evaluate a ~ b.
No such thing exists. There's no notion of syntactic equality in the logic, because it admits definitions (x ≡ T) and substitution (x ≡ y ⇒ P x ≡ P y).
What you could do instead is use ML's equality operator on terms. But for that, you have to use ML blocks.
I'm just starting playing with idris and theorem proving in general. I can follow most of the examples of proofs of basic facts on the internet, so I wanted to try something arbitrary by my own. So, I want to write a proof term for the following basic property of map:
map : (a -> b) -> List a -> List b
prf : map id = id
Intuitively, I can imagine how the proof should work: Take an arbitrary list l and analyze the possibilities for map id l. When l is empty, it's obvious; when
l is non-empty it's based on the concept that function application preserves equality.
So, I can do something like this:
prf' : (l : List a) -> map id l = id l
It's like a for all statement. How can I turn it into a proof of the equality of the functions involved?
You can't. Idris's type theory (like Coq's and Agda's) does not support general extensionality. Given two functions f and g that "act the same", you will never be able to prove Not (f = g), but you will only be able to prove f = g if f and g are defined the same, up to alpha and eta equivalence or so. Unfortunately, things only get worse when you consider higher-order functions; there's a theorem about such in the Coq standard library, but I can't seem to find or remember it right now.
Is the following TBox cyclic or acyclic? If it is a cyclic TBox, how could it be converted to an acyclic one?
A ⊑ ¬E
E ⊑ ¬A
A ⊑ ¬E
E ⊑ ¬A
This TBox doesn't really say anything except that the classes A and E are disjoint. The subclass relations could be read as implications:
If something is an A, then it is not an E.
If something is an E, then it is not an A.
To express disjointness in description logics, you'd typically say that the intersection of disjoint classes is equivalent, or a subclass, of the bottom concept, ⊥, which by definition has no instances. &bot is also the complement of the top concept, ⊤, which contains everything. Thus you could say any of the following:
A ⊓ E ⊑ ⊥
A ⊓ E ≡ ⊥
A ⊓ E ⊑ ¬⊤
A ⊓ E ≡ ¬⊤
To add what Joshua said, disjointedness representation depends upon the language you use. Example: EL doesnt support bottom and negation.
The axioms you have written is not cyclic.
Cycle: antecedent and consequent of an axiom should have at least one common predicate (Concept or role).
If an axiom contains a cycle, you have to adopt fixpoint semantics to make it unequivocal.
To the best of my knowledge, axioms are meant to get induced knowledge. Converting a cyclic axiom to an acylic axiom: It is difficult to produce similar semantics.
How to convert the following TBox axioms into an acyclic Tbox:
A \sqsubseteq \lnot E
\exists R.A \sqcap \lnot B \sqsubseteq C
C \sqsubseteq B \sqcup A
C = A \sqcup D
A \sqcap \exists R.E \sqsubseteq D
Lots of commonly useful properties of functions have concise names. For example, associativity, commutativity, transitivity, etc.
I am making a library for use with QuickCheck that provides shorthand definitions of these properties and others.
The one I have a question about is idempotence of unary functions. A function f is idempotent iif ∀x . f x == f (f x).
There is an interesting generalization of this property for which I am struggling to find a similarly concise name. To avoid biasing peoples name choices by suggesting one, I'll name it P and provide the following definition:
A function f has the P property with respect to g iif ∀x . f x == f (g x). We can see this as a generalization of idempotence by redefining idempotence in terms of P. A function f is idempotent iif it has the P property with respect to itself.
To see that this is a useful property observe that it justifies a rewrite rule that can be used to implement a number of common optimizations. This often but not always arises when g is some sort of canonicalization function. Some examples:
length is P with respect to map f (for all choices of f)
Converting to CNF is P with respect to converting to DNF (and vice versa)
Unicode normalization to form NFC is P with respect to normalization to form NFD (and vice versa)
minimum is P with respect to nub
What would you name this property?
One can say that map f is length-preserving, or that length is invariant under map fing. So how about:
g is f-preserving.
f is invariant under (applying) g.
If I have a set F of functional dependencies on the relation schema r(A, B, C, D, E, F):
A --> BCD
BC --> DE
B --> D
D --> A
What would B+ be??
I think B+ denotes the closure of B
"I think B+ denotes the closure of B"
That is usually the intended meaning of appending a plus sign to something, however that "something", in the context of functional dependencies and normalization theory, must refer to the set of functional dependencies.
B+, where B is one of the attributes, still is meaningless by any convention I know of.
So, to answer the question that OP presumably intended to ask, if we call S his given set of FDs {A->BCD D->A ...}, then S+ is another set of FDs, which includes ALL FDs that can possibly be derived from the given set, augmented with all trivial dependencies such as A->A.
For example, from A->BCD and A->A, we can infer A->ABCD. From D->A and A->BCD we can infer D->BCD. Those inferred FDs are member of S+, but not of S.
(PS this set is usually not particularly useful, unless internally in systems that do computations on sets of FDs, such as perhaps automated algorithms for key determination)
B+ denotes closure of B.
B --> D B+ = {BD}
D --> A B+ = {ABD}
A --> BCD B+ = {ABCD}
BC --> DE B+ = {ABCDE}
All the attributes of the relation can be found by B.
So, B is the primary key of the relation.