-
Notifications
You must be signed in to change notification settings - Fork 30
/
semantics.py
41 lines (27 loc) · 1.31 KB
/
semantics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""The goal in this module is to define functions associated with the semantics of formulas in propositional logic. """
from formula import *
from functions import atoms
def truth_value(formula, interpretation):
"""Determines the truth value of a formula in an interpretation (valuation).
An interpretation may be defined as dictionary. For example, {'p': True, 'q': False}.
"""
pass
# ======== YOUR CODE HERE ========
def is_logical_consequence(premises, conclusion): # function TT-Entails? in the book AIMA.
"""Returns True if the conclusion is a logical consequence of the set of premises. Otherwise, it returns False."""
pass
# ======== YOUR CODE HERE ========
def is_logical_equivalence(formula1, formula2):
"""Checks whether formula1 and formula2 are logically equivalent."""
pass
# ======== YOUR CODE HERE ========
def is_valid(formula):
"""Returns True if formula is a logically valid (tautology). Otherwise, it returns False"""
pass
# ======== YOUR CODE HERE ========
def satisfiability_brute_force(formula):
"""Checks whether formula is satisfiable.
In other words, if the input formula is satisfiable, it returns an interpretation that assigns true to the formula.
Otherwise, it returns False."""
pass
# ======== YOUR CODE HERE ========