I've read definition of these 2 notions on wiki, but the difference is still not clear. Could someone give examples and some easy explanation?
Difference between declarative and model-based specification
2.1k Views Asked by Konstantin Milyutin At
1
There are 1 best solutions below
Related Questions in TERMINOLOGY
- Difference between CPU Usage and CPU Utilization?
- What does the term "bitcode" mean?
- Is it OK to call a programming language a software?
- Array dimension terminology
- Is all dynamic binding a kind of polymorphism?
- Proper term for 'if (object)' as a non-null test?
- Is there a principal that requires this type of consistency in query results?
- What does a URI look like that is not a name?
- Why is string interpolation named the way it is?
- definition of the term "syntactic form"
- Bounding Box vs. Rectangle
- Term for sublist of all elements except last?
- Is there a term for operators which modify operands?
- When Teaching R, how to avoid the possible confusion with the term ''variable''?
- What exactly does "closing over" mean?
Related Questions in SPECIFICATIONS
- HTML5 progress range of max and value: too large values?
- What is the full list of standard keys recognized by the Java System.getProperty() method?
- Should variable bound in SELECT clause be accessible in ORDER BY?
- Text table of permitted content and content categories for HTML 5 elements
- Do javascript numbers follow IEEE 754 double precision?
- Why is <s> not listed as Phrasing Content on MDN?
- Is an <a> tag always phrasing content?
- OpenGL spec says that `GLint` must be 32 bits wide, but gl.xml naively defines it as `int` instead of `int32_t`. Why?
- Left Join in Spring Data JPA's Specification
- ConfigObj using configspec with enumerated sections
- Changed saved export specification on MS Access
- Is DocumentCSS interface from DOM Level 2 Style Specification implemented anywhere?
- Write a criteria query on elements of a Set
- Standards/specifications for WYSIWYG text editor development
- Spring specifications - subclasses in joins
Related Questions in ALLOY
- Alloy traces and projection issues
- Extract messages from Alloy Analyzer
- Alloy* does not stop solving in a very small higher-order space
- Purpose of Alloy models?
- Can Alloy model whether all cars can make the sharp turn in the road?
- What are the idioms used in modeling?
- How can an Alloy constraint put a set inside its subset?
- Alloy: a compact Java program to perform different run command scopes
- Keeping the value of a signature after running a predicate/ function?
- Refactoring in Alloy
- Run all the commands in the code instead of only the first one in Alloy
- How to use String in Alloy?
- Alloy - solution to Barber paradox still inconsistent
- Alloy Analyzer 4.1.10- Generting Large datasets
- Alloy - set difference leading to vars and clauses, set union does not
Related Questions in Z-NOTATION
- Applications of Objective-Z
- Formal Methods (Z-notation) - adding a new multiple relation
- How to represent unique attribute in Z-notation without quantifiers?
- Z Notation: Representation of a 2D array
- Find the image of a given value in a relation
- Return highest or lowest value Z notation , formal method
- Z notation specification to modify content of a set
- How to prove (p^q) ^ ( q -> r ) <-> r using Z- notation?
- Zed specification: Promotion and applying an operation more than one schema
- Zed Notation in LyX
- Downloading Z specification for mac
- In Z notation, how to define a division operation for integer numbers
- Why is there a difference of one in down function of Z notation for the solution to 8 Queen problem?
- Difference between declarative and model-based specification
- Z specifications in LaTeX
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
A declarative specification describes an operation or a function with a constraint that relates the output to the input. Rather than giving you a recipe for computing the output, it gives you a rule for checking that the output is correct. For example, consider a function that takes an array a and a value e, and returns the index of an element of the array matching e. A declarative specification would say exactly that:
In contrast, an operational specification would look like code, eg with a loop through the indices to find i. Note that declarative specifications are often non-deterministic; in this case, if e matches more than one element of e, there are several values of i that are valid (and the specification doesn't say which to return). This is a powerful feature. Also, declarative specifications are often not total: here, for example, the specification assumes that such an i exists (and in some languages you would add a precondition to make this explicit).
To support declarative specification, a language must generally provide logical operators (especially conjunction) and quantifiers.
A model-based language is one that uses standard mathematical structures (such as sets and relations) to describe the state. Alloy and Z are both model based. In contrast, algebraic languages (such as OBJ and Larch) use equations to describe state implicitly. For example, to specify an operation that inserts an element in a set, in an algebraic language you might write something like
which says that after you insert e into s, the element x will be a member of the set if you just inserted that element (e is equal to x) or if it was there before (x is a member of s). In contrast, in a language like Z or Alloy you'd write something like
with a constraint relating the new value of the set (s') to the old value (s).
For many examples of declarative, model-based specification, see the materials on Alloy at http://alloy.mit.edu, or my book Software Abstractions. You can also see comparisons between model-based declarative languages through an example in the appendix of the book, available at the book's website http://softwareabstractions.org.