GithubHelp home page GithubHelp logo

logic-nor's Introduction

nor.scm

This Scheme (Racket) program demonstrates that the truth function logical NOR(↓) is functionally complete, namely, that any binary truth function f: {0,1}×{0,1}→{0,1} is given by a composition just of NOR.

Description

The higher-order function truth-func, constructed with only NOR, take six arguments map-11, map-10, map-01, map-00, x, y, where the function map-xy is composed just of NOR and x, y are truth values, and return the binary truth function which value of arguments (x, y) is equal to the (map-xy x y).

So, if a func-imply is defined as below:

(define func-imply
  (lambda (x y)
    (truth-func
      map-11-1
      map-10-0
      map-01-1
      map-00-1
    x y)
  )
)

where the map-xy-z maps truth values (x, y) to z, then the func-imply turns out to be the logical IMP(⇒) itself. In fact,

(func-imply #t #t)
(func-imply #t #f)
(func-imply #f #t)
(func-imply #f #f)

outputs

#t
#f
#t
#t

logic-nor's People

Contributors

tani-ro-hei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.