preference_functions.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Defeasible-Conditional-Deontic-Logic-Solver 作者: alabecki 项目源码 文件源码
def obtain_atomic_formulas(file):
    propositions = set()
    for line in file:
        if line.startswith("("):
            prop_char = set()
            for char in line:
                #print(str(char))
                if(str(char).isalpha()):
                    prop_char.add(str(char))
            for item in prop_char:
                new = Symbol(item)
                propositions.add(new)
    return propositions                     #returns the set of propositions involved in the set of rules


# Parses each line of the rule file to create a a dictionary of rules, distinguishing the item, body and head. The key is the name of the rule
# while the value is the Rule object itself
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号