Coder Social home page Coder Social logo

cl-prolog's Introduction

Cl-prolog

This is the prolog implementation of chapter 11 form PAIP.

How to use

Loading

  • Load the packge:
CL-USER> (ql:quickload :cl-prolog)
To load "cl-prolog":
  Load 1 ASDF system:
    cl-prolog
; Loading "cl-prolog"

(:CL-PROLOG)
  • Change the current packge
CL-USER> (in-package :cl-prolog)
#<PACKAGE "CL-PROLOG">

Using

<- Add a clause to the data base

?- Prove a query and print answer(s)

; To see more solutions

. To don’t see more solutions

Tests

CL-PROLOG> (<- (member ?item (?item . ?rest)))
MEMBER
CL-PROLOG> (<- (member ?item (?x . ?rest)) (member ?item ?rest))
MEMBER
CL-PROLOG> (?- (member 2 (1 2 3 2 1)))
Yes;

Yes;

No.
; No value
CL-PROLOG> (?- (member 2 ?list))
?LIST = (2 . ?REST732);

?LIST = (?X733 2 . ?REST737);

?LIST = (?X733 ?X738 2 . ?REST742);

?LIST = (?X733 ?X738 ?X743 2 . ?REST747).

No.
; No value

cl-prolog's People

Contributors

hmuniz avatar

Watchers

Alexandre Rademaker avatar  avatar

cl-prolog's Issues

Exercícios

Copie também o texto dos exercícios. Vc pode usar arquivos .org com lisp embutido para quando forem mudanças pontuais ou novos arquivos lisp como vc fez com comentários com a descrição do exercício.

instrução de como usar?

Tentei clonar no quicklisp/local-projects e carregar mas tive o erro:

* (ql:quickload :cl-prolog)
To load "cl-prolog":
  Load 1 ASDF system:
    cl-prolog
; Loading "cl-prolog"
[package cl-prolog]
debugger invoked on a SB-EXT:DEFCONSTANT-UNEQL in thread
#<THREAD "main thread" RUNNING {10019B6F33}>:
  The constant NO-BINDINGS is being redefined (from ((T . T)) to ((T . T)))
See also:
  The ANSI Standard, Macro DEFCONSTANT
  The SBCL Manual, Node "Idiosyncrasies"

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] Go ahead and change the value.
  1: [ABORT                        ] Keep the old value.
  2: [TRY-RECOMPILING              ] Recompile pattern-matching and try loading it again
  3: [RETRY                        ] Retry
                                     loading FASL for #<CL-SOURCE-FILE "cl-prolog" "pattern-matching">.
  4: [ACCEPT                       ] Continue, treating
                                     loading FASL for #<CL-SOURCE-FILE "cl-prolog" "pattern-matching">
                                     as having been successful.
  5:                                 Retry ASDF operation.
  6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  7:                                 Give up on "cl-prolog"
  8:                                 Exit debugger, returning to top level.

(SB-C::%DEFCONSTANT NO-BINDINGS ((T . T)) #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/Users/arademaker/quicklisp/local-projects/cl-prolog/pattern-matching.lisp" :INDICES 98305) "Indicates pat-match success, with no variables.")

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.