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
- Precise definitions of promotion and lifting
- Usage of the Term 'directive' for Control Flow Statements
- Is the SQL in brackets a scalar subquery?
- Common name for index for lexicographical sorting
- Is there a common name for variables which are not local and not global?
- What is a "Scalar" in PowerShell
- What is the difference between C++ "data member" and "field"?
- What is the term for a function/operation that is reversible by using the same function again?
- Can I rightfully name my opened file a stream if at some point I move its file-pointer backward?
- Definition of "operator", and by extension "operand", in Python terminology
- What do these terms "L0+", "L0" and "L+" stand for with respect to memory pool?
- What is the technical name for, "Unrelated asynchronous call stacks?" I want to say, "How do I wait until an unrelated ___ completes?"
- What are the generic terms for HTTP Pipelines and HTTP Modules, which seem to be .Net-specific terminology
- How would call the process of roughening Data to make it more realistic?
- What is the term for a function that can resume from error?
Related Questions in SPECIFICATIONS
- Django miss static files after packaging with pyinstaller
- JPA SPECIFICATION WITH INTERFACE PROJECTIONS
- Error in Bluetooth specification? Heading field of Location and Speed
- onEdit() dependent on more than 1 variable
- Check for array intersection with Spring JPA and Specification API
- Joining multiple tables in Criteria ruins the expected output
- Is there a way to return the aggregate count in a Dynamic Projection with Specification in JPA?
- What does a single CR mean ? (telnet)
- What is the behaviour of GA without ECHO? (telnet)
- How do bluetooth speakers / headsets / devices exchange battery level information? (especially with an Android device)
- Is it valid to write '<' and '>' in HTML5 with spaces surrounding them or must they always be written as HTML entities?
- Using C format specifications in C#
- How to write two parameters in OAS3 spec file?
- Yaml. Formatted Content depicted as a serialization detail. Isn't it a presentation detail?
- JPA Specification instance change after use?
Related Questions in ALLOY
- How to visualize a graph having multiple edge types in Alloy
- How to debug Alloy if the outcome is not as expected?
- How to set up visualization of event-style models
- MUS cores in Alloy UNSAT models
- Alloy executing same model with different combination of Facts or Predicates
- How can I get all instances at once in Alloy* analyzer?
- Should the book example be refined to avoid inconsistent results
- How to integrate Regex into Alloy Analyzer?
- Alloy6 allowing invalid state transitions
- From predicate calculus style to relation calculus style in Alloy
- Alloy analyser - only natural numbers - no integer set
- Pass parameter to predicate with Alloy Java API
- Implication vs. Disjunction operators
- Alloy: unexpected instance, difference between Sig'=Sig & Sig.field' = Sig.field
- Nested maps in Alloy
Related Questions in Z-NOTATION
- Z notation specification to modify content of a set
- Installing Fuzz. Error: exp ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘x_slot’ected
- Isabelle/HOL with HOL-Z and ZETA
- Find the image of a given value in a relation
- Z Notation: sequence of sequences - find sum
- How to prove (p^q) ^ ( q -> r ) <-> r using Z- notation?
- Why is there a difference of one in down function of Z notation for the solution to 8 Queen problem?
- object-Z specification of credit card using eclipse
- Z notation to prolog
- How to represent sequential operation schemas [Z-notation]
- Z notation: How to write operation schema that may add one or more tuples to a relation
- Formatting of Strings in Latex in whitespace insensitive environment / Z-Notation Schema
- How to represent unique attribute in Z-notation without quantifiers?
- How to do inclusion of schema in other schema using Z language
- Zed specification: Promotion and applying an operation more than one schema
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 # Hahtags
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.