Article View: comp.lang.prolog
Article #1687Re: '->' operator
From: Michael A. Covington
Date: Fri, 04 Jan 1991 03:09
Date: Fri, 04 Jan 1991 03:09
32 lines
1728 bytes
1728 bytes
In article <291@valverde.cs.utexas.edu> bradley@cs.utexas.edu (Bradley L. Richards) writes: >I have a (probably silly) question regarding the '->' operator in Quintus. >Suppose I say > > Condition -> Predicate > >If the condition is true, the predicate will execute. Fine. > >If the condition is true and the predicate fails, the whole conditional fails. > This makes sense since logically (true -> false) is false. > >If the condition is true and the predicate is true, the whole thing succeeds. > This makes sense since (true -> true) is true. > >BUT if the conditional is false, the ugly little beastie fails--this doesn't > make sense since logically (false -> anything) is *true*. > >Why is this implemented the way it is? > >Thanks, >Bradley >bradley@cs.utexas.edu Generally, "false -> anything" is not true in Prolog. Prolog is not quite the same as classical logic. The main differences are (1) limitations on the form of formulas, and (2) absence of explicit negation (in Prolog, "not P" means "unable to prove P"). Further, the -> operator is not intended to be an encoding of anything in classical logic. It is a Pascal-like, *procedural* if-then-else construct, designed to make it easier to express algorithms. The equivalent of classical logic "implies" is :- .
Technical Details
Message-ID:
<1991Jan4.030918.24996@athena.cs.uga.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!emory!athena.cs.uga.edu!mcovingtReferences:
<291@valverde.cs.utexas.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!emory!athena.cs.uga.edu!mcovingt From: mcovingt@athena.cs.uga.edu (Michael A. Covington) Newsgroups: comp.lang.prolog Subject: Re: '->' operator Message-ID: <1991Jan4.030918.24996@athena.cs.uga.edu> Date: 4 Jan 91 03:09:18 GMT References: <291@valverde.cs.utexas.edu> Organization: University of Georgia, Athens Lines: 32