问题标签 [functional-dependencies]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
321 浏览

database - 2NF(归一化)中的一些混淆

在 2NF 中规范化时我有些困惑

考虑一组 FD

这里的键是 ABD,ABC

主要属性-A,B,C,D

非主属性-E

2NF-对于处于 2NF 中的关系,非素数属性应该完全依赖于键。

FD3会违反2NF吗?CD 是密钥的正确子集吗?我还想问一件事,当它违反 2NF 时,我们如何决定将哪个 FD 放在单独的关系中?请帮忙

0 投票
3 回答
1381 浏览

sql - 关系数据库设计中的功能依赖问题

如果我对关系模式 r(A, B, C, D, E, F) 有一组函数依赖项 F:

A --> BCD

公元前 --> 德

B --> D

D --> A

B+会是什么??

0 投票
1 回答
1521 浏览

haskell - Functional Dependency in Haskell

I cannot really get it. Why do we need it at all? I mean if I use the same type parameter, I think that means they should be the same type.

I heard it can help the compiler to avoid the infinite loop. Can someone tell me some more details about that?

In the end, are there any 'patterns and practices' we should follow on the usage of functional dependency in Real World Haskell?

[Follow-up Question]

In the code above, I used the same type variable 'a' for both container and element, I think the compiler can thus infer that these two types are the same type.

But when I tried this code in GHCi, I got the following feedback:

When one of them has been specified to be type 'Char', why the other one is still unresolved type 'element'?

0 投票
2 回答
586 浏览

haskell - Functional Dependencies / Type Families - AST

I was recently introduced to functional dependencies and type families. For a class project I wrote (completed) an interpreter for a subset of C in Java and Haskell. The Haskell implementation of an evaluation function for terms required building "function tables" with explicit pattern matching and unwrapping of value constructors representing literals. An unhappy situation (but much prettier than the Java).

After searching for a while, I came across the "collections" example, wondering if I could apply this to my abstract syntax to produce generic "inject to" and "project from" functions for literals. I came up with two initial test attempts:

(Using functional dependencies: the injection and projection functions work without explicit type annotations, as does injection into Lit with lit. However, the projection function from Lit will not type, giving the error "couldn't match expected type l against inferred type l'".)

(Using type families. The problem here is that I can't get Haskell to infer from an argument the correct return type without explicit annotation, and I can't write the generic functions lit :: Val l -> E and unlit :: E -> Val l.)

I don't understanding type families well, and have a flimsy grasp on functional dependencies. But I'd like to know two things: (a) if the functions I want can be typed and implemented; (b) If I am misunderstanding something fundamental here. It almost works, but I've been fighting with the type checker for a while now.

EDIT This is a simple model of what I want, since it was unclear. The class Bin implements the functionality I want, basically. But I can't collect the various "wrappable and unwrappable" values together to make an AST out of this.

0 投票
1 回答
152 浏览

requirements - 请查看这些要求,我有点迷失了

嗨,我确定功能和非功能要求,这些是否正确?

功能:

玩家创建帐户。

玩家选择区域。

播放器 选择播放器类型。

Player TypeA/Player Typeb 查看游戏统计数据。

Player TypeA 查看对手列表。

Player TypeA/Player Typeb 从工作列表中选择目标/刺客。

Player TypeA/Player Typeb 查看对手地图。

玩家 TypeA 查看武器。

玩家TypeA装备武器。

玩家 TypeA 射击武器;计算命中概率。

打击对手球员被击中;对手被淘汰 玩家 TypeA 获得积分。

Player TypeA/Player Typeb 发送消息。

玩家 Typeb 查看目标历史。

该程序需要 GPS 连接这是功能要求吗?

非功能性:????? 他们将基于我的功能是什么?

如果他们能回答我的问题,我会认真地给每个人饼干!

0 投票
1 回答
677 浏览

rdbms - 功能依赖和规范化

考虑关系 R = {P, Q, R, S, T} 和函数依赖 F = {P -> Q, {Q, R} -> S, S -> {Q, R}, {S, T } -> phi}。F 中是否存在任何冗余的函数依赖关系?如果是,则删除它们并将关系 R 分解为 3NF 关系。

请回答这个

0 投票
3 回答
17432 浏览

functional-dependencies - 考虑以下对关系模式 r(A,B,C,D,E,F) 的函数依赖集 F:

我试图联系我的导师,但没有成功,我真的很想了解这个过程,但无论我读了多少材料,我似乎都无法让它适合我的小脑袋。有人可以帮我解决以下问题吗?

一个。计算 B+。

我相信这个如下。这似乎是正确的吗?

B+ 表示 B 的闭包。
B --> D
B+ = {BD}
D --> A
B+ = {ABD}
A --> BCD
B+ = {ABCD}
BC --> DE
B+ = {ABCDE}

关系的所有属性都可以被B找到。所以,B是关系的主键。

湾。证明(使用阿姆斯壮公理)AF 是一个超级键。

我不明白如何处理 F,因为它没有出现在上述关系中。

C。计算上述函数依赖集 F 的规范覆盖;解释推导的每一步。

d。给出基于规范覆盖的 r 的 3NF 分解。

0 投票
1 回答
159 浏览

database - 依赖理论 - 问题

在过去的几个小时里,我一直在努力解决这个问题,我在下面列出了我找到的唯一答案,似乎它可能会去某个地方,有人可以告诉我我是否走在正确的轨道上:

问题:

Q->WR 持有

任何意见,将不胜感激

0 投票
6 回答
77302 浏览

database - 从功能依赖中确定键

我正在上一门数据库理论课程,在阅读了如何在给定一组功能依赖项的情况下推断密钥后,我并不清楚。

我有一个示例问题:

查找具有函数依赖关系的关系 R(ABCDEFG) 的所有键

通过确定以下哪些是关键来展示您的知识。

有人可以指导我如何分解功能依赖项以得出某些属性组合是关键的结论吗?我预计我将面临许多此类问题,我需要了解如何解决它。

0 投票
1 回答
129 浏览

database-design - 关于功能依赖的问题

我必须为以下 FD 集找到最小的掩护,

AB -> D D-> B

我不熟悉发现封面,是否有可能?上面我觉得棘手的是一种循环关系?