This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
magik-demo:developer:class:core:programgenerator [2013/07/25 16:55] alex [makeEDB_Atom] |
magik-demo:developer:class:core:programgenerator [2017/07/06 15:24] (current) |
||
|---|---|---|---|
| Line 225: | Line 225: | ||
| ---- | ---- | ||
| - | ==== makeEDB_Atom ==== | + | ==== make_Q_a_vals ==== |
| <code java> | <code java> | ||
| Line 248: | Line 248: | ||
| ---- | ---- | ||
| - | ==== makeEDB_Atom ==== | + | ==== makeSkolemRule ==== |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | public static java.util.ArrayList<java.lang.String> makeSkolemRule (ForeignKey fk, |
| - | boolean isUnfolding) | + | boolean isUnfolding) |
| </code> | </code> | ||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | + | Apply Skolem rule to foreign key |
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | + | * fk - foreign key |
| * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | ||
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * list of ... |
| ---- | ---- | ||
| - | + | ==== makeAuxRule ==== | |
| - | ==== makeEDB_Atom ==== | + | |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | public static java.lang.String makeAuxRule (ForeignKey fk, |
| - | boolean isUnfolding) | + | boolean isUnfolding) |
| </code> | </code> | ||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | + | Create aux rule from a foreign key |
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | + | * fk - foreign key to convert |
| * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | ||
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * Line of code for aux rule for foreign key |
| ---- | ---- | ||
| - | |||
| ==== makeEDB_Atom ==== | ==== makeEDB_Atom ==== | ||
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | public static java.lang.String makeCopyRule (ForeignKey fk, |
| - | boolean isUnfolding) | + | boolean isUnfolding) |
| </code> | </code> | ||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | + | Make the copy rule for a given foreign key |
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | + | * fk - foreign key that needs the copy rule |
| * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | ||
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * Line of code for copy rule related to the foreign key |
| + | ---- | ||
| + | ---- | ||
| ---- | ---- | ||
| - | ==== makeEDB_Atom ==== | + | ==== unfoldTC_Atom ==== |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | static java.lang.String unfoldTC_Atom (Atom atom, |
| - | boolean isUnfolding) | + | boolean isUnfolding) |
| </code> | </code> | ||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | + | Creates the line of code related to unfolded atom of the TC-statement |
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | + | * atom - atom that we want to unfold |
| * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | ||
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * Line of code generated for the unfolded atom |
| ---- | ---- | ||
| - | ==== makeEDB_Atom ==== | + | ==== make_a (String) ==== |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | static java.lang.String make_a (java.lang.String atom){ |
| - | boolean isUnfolding) | + | |
| </code> | </code> | ||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | + | This function takes an atom (in String format) and return the same one but with _a prefix to the name |
| **Parameters:** | **Parameters:** | ||
| * atom - atom that we want to convert | * atom - atom that we want to convert | ||
| - | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | ||
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * String of the atom with the _a prefix |
| ---- | ---- | ||
| - | + | ==== makeDoubleVal ==== | |
| - | ==== makeEDB_Atom ==== | + | |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | static java.lang.String makeDoubleVal (Term a, |
| - | boolean isUnfolding) | + | Term b) |
| </code> | </code> | ||
| - | |||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | ||
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | + | * a - term |
| - | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | + | * b - term |
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * String |
| ---- | ---- | ||
| - | ==== makeEDB_Atom ==== | + | ==== makeVal ==== |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | static java.lang.String makeVal (Term a, |
| - | boolean isUnfolding) | + | Term b) |
| </code> | </code> | ||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | + | Create the val line of code for two terms |
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | + | * a - term |
| - | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | + | * b - associated term to assign to term a |
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * Val rule for the term a assigned the value of the term b |
| ---- | ---- | ||
| - | ==== makeEDB_Atom ==== | + | ==== createMaybe_V_vector_Y ==== |
| <code java> | <code java> | ||
| - | static java.lang.String makeEDB_Atom (Atom atom, | + | private static java.lang.StringBuilder createMaybe_V_vector_Y (boolean isUnfolding, |
| - | boolean isUnfolding) | + | int keyTarget) |
| </code> | </code> | ||
| - | |||
| - | An internal auxiliary function, needed for conversion of atoms of the query to prototypical EDB. | ||
| **Parameters:** | **Parameters:** | ||
| - | * atom - atom that we want to convert | ||
| * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | * isUnfolding - //TRUE// if unfolding needed, //FALSE// no unfolding | ||
| + | * keyTarget - key taget | ||
| **Return** | **Return** | ||
| - | * String with the extensional database definition of the atom | + | * String Builder |
| ---- | ---- | ||
| + | ==== create_vector_Y ==== | ||
| + | |||
| + | <code java> | ||
| + | private static StringBuilder create_vector_Y (int keyTarget) | ||
| + | </code> | ||
| + | |||
| + | **Parameters:** | ||
| + | |||
| + | * keyTarget - index of the key target | ||
| + | |||
| + | **Return** | ||
| + | * String Builder | ||
| + | [[magik-demo:developer:class:core:programgenerator|Back to Top]] | [[magik-demo:start|Back to Home Page]] | ||