Editing
Predicate Logic
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Modeling 'The Database Query' (Translating English into Predicate Logic):''' <syntaxhighlight lang="python"> def evaluate_predicate(domain, predicate_func, quantifier): """ Simulates β and β logic. """ results = [predicate_func(obj) for obj in domain] if quantifier == "ALL": # β return all(results) elif quantifier == "EXISTS": # β return any(results) return None # World: [1, 2, 3, 4] | Predicate: "Is even?" numbers = [1, 2, 3, 4] is_even = lambda x: x % 2 == 0 # Check: "Are ALL numbers even?" (βx Even(x)) print(f"βx Even(x): {evaluate_predicate(numbers, is_even, 'ALL')}") # Check: "Is there SOME number that is even?" (βx Even(x)) print(f"βx Even(x): {evaluate_predicate(numbers, is_even, 'EXISTS')}") </syntaxhighlight> ; Logic Landmarks : '''Begriffsschrift (1879)''' β Gottlob Frege's book that "Invented" modern predicate logic, often called the "Most important work in logic since Aristotle." : '''Principia Mathematica (1910)''' β Russell and Whitehead's attempt to derive all of math from pure predicate logic (a massive task that took 2,000 pages). : '''SQL (1974)''' β The standard language for databases, which is literally just "Predicate Logic in a Suit." : '''Prolog (1972)''' β The first "Logic Programming Language," where you don't write "Steps," you just write "Facts and Rules" in predicate logic, and the computer finds the answer for you. </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information