IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Scheme Discussion :

Système expert avec Scheme ?


Sujet :

Scheme

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Février 2008
    Messages
    17
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 17
    Par défaut Système expert avec Scheme ?
    Bonjour tout le monde,

    Quelqu'un aurait-il un petit exemple d'un système expert sous scheme svp ? Je voudrais l'executer pour voir comment le moteur d'inférence de Scheme opére.
    J'utilise DrScheme 3.72.

    Un grand merci d'avance.

  2. #2
    Rédacteur/Modérateur

    Avatar de gorgonite
    Homme Profil pro
    Ingénieur d'études
    Inscrit en
    Décembre 2005
    Messages
    10 322
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur d'études
    Secteur : Transports

    Informations forums :
    Inscription : Décembre 2005
    Messages : 10 322
    Par défaut
    scheme n'a pas de moteur d'inférence intégré à ma connaissance... si tu ne veux pas le programmer toi-même regardes du côté de prolog
    Evitez les MP pour les questions techniques... il y a des forums
    Contributions sur DVP : Mes Tutos | Mon Blog

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Février 2008
    Messages
    17
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 17
    Par défaut
    Citation Envoyé par gorgonite Voir le message
    scheme n'a pas de moteur d'inférence intégré à ma connaissance... si tu ne veux pas le programmer toi-même regardes du côté de prolog
    ah bon ? J'ai lu quelques part que Scheme avait un moteur d'inférence et qu'on pouvait executer dessous des systémes expert.

    C'est pour ca que je voulais avoir un exemple d'un petit systéme expert pour voir comment Scheme opérait.

    Svp, verifiez moi si Scheme a bien un moteur d'inférence ou pas ?

    Encore une énorme merci d'avance

  4. #4
    Inactif  
    Profil pro
    Inscrit en
    Juillet 2005
    Messages
    1 958
    Détails du profil
    Informations personnelles :
    Âge : 60
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 1 958
    Par défaut
    Comme le dis Gorgonite, il n'y a pas de système-expert fourni avec DrScheme. Par contre, il est certain qu'il existe des systèmes experts fait avec DrScheme.
    Dans un contexte professionnel, je pense, cependant, que les gens auront tendances à utiliser CLIPS qui est déjà rodé.

    Mais en cherchant, tu devrais trouver des projets de S.E., écrit en mzscheme, sur Internet. Si tu achètes le livre de Chazarain, tu as un exemple de système-expert avec chaînage arrière (chapitre 18 du livre)

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2004
    Messages : 8
    Par défaut
    bonjour,

    drscheme propose un package avec un moteur d'inférence :

    http://planet.plt-scheme.org/package...nce/index.html

    un exemple d'utilisation avec le jeu des tours de hanoi...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
      #lang scheme/base
      ; PLT Scheme Inference Collection
      ; towers-alist.ss
      ;
      ; Towers of Hanoi from Artificial Intelligence: Tools, Techniques,
      ; and Applications, Tim O'Shea and Marc Eisenstadt, Harper & Rowe,
      ; 1984, pp.45
      ;
      ; The rules of the game are: (1) move one ring at a time and (2)
      ; never place a larger ring on top of a smaller ring. The object
      ; is to transfer the entire pile of rings from its starting
      ; peg to either of the other pegs - the target peg.
      
      (require (planet williams/inference/inference))
      
      (define-ruleset towers-rules)
      
      ; If the target peg holds all the rings 1 to n, stop because
      ; according to game rule (2) they must be in their original order
      ; and so the problem is solved.
      (define-rule (rule-1 towers-rules)
          (all (ring ? (on . right)))
        ==>
          (succeed))
      
      ; If there is no current goal - that is, if a ring has just been
      ; successfully moved, or if no rings have yet to be moved -
      ; generate a goal. In this case the goal is to be that of moving
      ; to the target peg the largest ring that is not yet on the target
      ; peg.
      (define-rule (rule-2 towers-rules)
          (no (move . ?))
          (ring ?size (on ?peg (not (eq? ?peg 'right))))
          (no (ring (?size-1 (> ?size-1 ?size))
                    (on ?peg-1 (not (eq? ?peg-1 'right)))))
        ==>
          (assert `(move (size . ,?size)
                         (from . ,?peg)
                         (to . right))))
      
      ; If there is a current goal, it can be achieved at once of there
      ; is no small rings on top of the ring to be moved (i.e. if the
      ; latter is at the top of its pile), and there are no small rings
      ; on the peg to which it is to be moved (i.e. the ring to be moved
      ; is smaller that the top ring on the peg we intend to move it to).
      ; If this is the case, carry out the move and then delete the
      ; current goal so that rule 2 will apply next time.
      (define-rule (rule-3 towers-rules)
          (?move <- (move (size . ?size) (from . ?from) (to . ?to)))
          (?ring <- (ring ?size (on . ?from)))
          (no (ring (?size-1 (< ?size-1 ?size)) (on . ?from)))
          (no (ring (?size-2 (< ?size-2 ?size)) (on . ?to)))
        ==>
          (printf "Move ring ~a from ~a to ~a.~n" ?size ?from ?to)
          (replace ?ring `(ring ,?size (on . ,?to)))
          (retract ?move))
      
      ; If there is a current goal but its disc cannot be moved as in
      ; rule 3, set up a new goal: that of moving the largest of the
      ; obstructing rings to the peg that is neither of those specified
      ; in the current goal (i.e. well out of the way of the current
      ; goal). Delete the current goal, so that rule 2 will apply to the
      ; new goal next time.
      (define-rule (rule-4 towers-rules)
          (?move <- (move (size . ?size) (from . ?from) (to . ?to)))
          (peg (?other (not (memq ?other (list ?from ?to)))))
          (ring (?size-1 (< ?size-1 ?size))
                (on ?peg-1 (not (eq? ?peg-1 ?other))))
          (no (ring (?size-2 (< ?size-1 ?size-2 ?size))
                    (on ?peg-2 (not (eq? ?peg-2 ?other)))))
        ==>
          (replace ?move `(move (size . ,?size-1)
                                (from . ,?peg-1)
                                (to . ,?other))))
      
      ; The main routine:
      ; In a new inference environment:
      ; Activate the towers rule set.
      ; Optionally, turn on tracing.
      ; Create the three pegs - left, middle, and right.
      ; Create the n rings.
      ; Start the inference.
      ; The rules will print the solution to the problem.
      (define (solve-towers n)
        (with-new-inference-environment
         (activate towers-rules)
         ; (current-inference-trace #t)
         ; Create pegs.
         (assert '(peg left))
         (assert '(peg middle))
         (assert '(peg right))
         ; Create rings.
         (for ((i (in-range 1 n)))
           (assert `(ring ,i (on . left))))
         ; Start inferencing.
         (start-inference)))
      
      ; Test with 6 disks.
      (solve-towers 6)

Discussions similaires

  1. Système Expert avec Eclipse
    Par medchok dans le forum Eclipse
    Réponses: 4
    Dernier message: 16/04/2009, 12h23
  2. Réponses: 1
    Dernier message: 17/03/2008, 20h54
  3. [Système] Problème avec header() ...
    Par tom06440 dans le forum Langage
    Réponses: 15
    Dernier message: 27/10/2005, 21h33
  4. [Système]Probleme avec un chemin dans cmd.exe
    Par Sarrus dans le forum API standards et tierces
    Réponses: 3
    Dernier message: 14/09/2005, 08h31
  5. système expert ou pas
    Par Rmotte dans le forum Langages de programmation
    Réponses: 6
    Dernier message: 03/10/2003, 13h36

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo