100 likes | 232 Vues
This article delves into finite domain constraint programming, illustrated through a classic problem involving measuring with jugs. We explore alphanumeric variables and atoms in programming, particularly in the Oz language. The discussion covers essential algorithms, the structure of functions, and the nuances of constraints in programming, showcasing how these concepts translate into functional code. Additionally, we highlight the multiple solutions achievable within this framework, emphasizing its relevance in unexpected areas. Join us as we bridge theoretical concepts with practical programming examples.
E N D
A Solution in Finite Domain Measuring With Jugs
* variables -- a set of alphanumeric characters starting with a CAPITAL letter * atoms -- set of alphanumeric characters beginning with a lower case letter (anAtom in would be equivalent in Java to"anAtom") * keywords – declare, fun, Browse Intro to Oz
-- virtual strings a#b#c -- lists [a b c] -- records sol(A B C) #(a b c) Other Neat Stuff
This is what an Oz Program looks like: Functions
background -- others who have analyzed it explanation CapA*TimesA-CapA*TimesANeg The Algorithm
+ finite domain integers + constraints + how it works (as opposed to logic programming like Prolog) Constraint Programming
- 2 jugs - n jugs - show output - explain output numbers CapA*TimesA-CapA*TimesANeg Constraint Programming AppliedAlgorithm to Code
+ show structure of functions + show code bits + show output Numbers to Operations
May include this! Multiple Solutions
This shows that Finite Domain Constraint Programming is useful for areas where it might not at first seem useful. Conclusion