Skip to content

nikos-alexandris/constraint-propagator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Simple Constraint Propagator in Scheme

(Tested compatibility with mit-scheme and chicken-scheme)

Functions:

  • (<+> x y) addition
  • (<-> x y) subtraction
  • (<*> x y) multiplication
  • (</> x y) division
  • (<=> x y) equality
  • (<?> x) get value
  • (<!> x) remove value
  • (<var> name) new variable

Examples:

(define (pythagorean-triplet a b c)
  (<=> (<+> (<*> a a) (<*> b b)) (<*> c c)))

> (define a (<var> 'a))
> (define b (<var> 'b))
> (define c (<var> 'c))
> (pythagorean-triplet a b c)
> (<=> a 3)
    Variable a = 3
> (<=> c 5)
    Variable b = 4
    Variable c = 5

About

Constraint Propagator in Scheme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages