Why full Chomsky hierarchy is so detailed, if there are decidable recursive languages?

One can have a look on the Chomsky hierarchy https://en.wikipedia.org/wiki/Chomsky_hierarchy , especially the inset named “Automata theory: formal languages and formal grammars” at the bottom of the page. When one tries to model natural language (e.g. as http://www.grammaticalframework.org/ tries to do it), then one usually aims for the most expressive formal language that is still decidable and recursive languages are exactly such languages – they are the most expressive decidable languages. But GrammaticalFramework instead narrows the scope and uses the mildly context-sensitive language instead for doing its modelling. Why it is so? Why one elaborates the hierarchy of languages, what compromises he or she tries to make?

As far as I understand from my studies, then the complexity issue is the single most important issue. One can try to use recursive language, but recognition and parsing of such languages are very slow. Or maybe there are different reasons? Maybe there are not even algorithms how convert recursive language into total Turing machine (and vice versa) or maybe there are not even algorithms for the parsing of recursive language. So – why not to use recusive language? Due to lack of algorithms? Or due to nonpolynomial/exponential complexities of those algorithms? And that is why the hierarchy is so elaborated – one can try to find the most expressible language with the best complexity properties.

It is somehow different with logics. In logics one can tolerate the complexity issue and one is required to make compromises between expressibility and decidability. For recursive languages the recognition is decidable and so one should seek compromises between expressibility and complexity. Am I right?

The key point of my question is this: what obstacles prevent the practical use of recursive languages and why one is required to elaborate hierarchy of languages and to use less expressive languages? Complexity? Lack of algorithms? Something different?

SPHierarchyDataSourceControl doesn’t show all hierarchy when user has permission only to Document Library

I am working with SP2013 using SPHierarchyDataSourceControl to show the user a tree with all sites, document Libraries and folders in SiteCollection.

I found a bug now:

When User has permissions only to a Document Library in the hierarchy, he see nothing in the tree. I want him to see all the nodes that are up in the hierarchy.

My Code:

<SharePoint:SPHierarchyDataSourceControl id="ds1" runat="server"  RootContextObject="Web" ShowDocLibChildren="true" ShowFolderChildren="true" ShowListChildren="true" ShowWebChildren="true" IncludeDiscussionFolders="false" /> 

Code Behind:

ds1.Web = SPContext.Current.Site.RootWeb; ds1.RootWebId = SPContext.Current.Site.RootWeb.ID.ToString(); ds1.RootContextObject = null; 

Does anyone have an idea ?

thanks.

drupal view based on logged in user and hierarchy level of taxonomy terms

Am trying to create a drupal view that is to show content classified by taxonomy term and the hierarchy level of the logged in user within that taxonomy vocabulary. For instance, the content is organized in 10 different levels of a taxonomy ranking, and each user is progressing through each level of that taxonomy (in an educational pathway), and we want to show all content of those levels that the user has reached and could have possibly have gone through up to that point. For example if the user has reached level 5 (or has been given that rank by admin), the view will show all content for levels 1 through 5, but not anything higher. If user is level 7, then the view will show all content with taxonomy 1 through 7 but nothing higher. Any help is MUCH APPRECIATED!

System T, System F and arithmetical hierarchy

I refer to Proof and Types by Jean-Yves Girard for the definition of System T (pag. 46) and System F (pag. 81). In this treatise there are two base types, i. e. $ \text{Int}$ (natural numbers) and $ \text{Bool}$ (booleans), so I suppose that the type $ \text{Int} \rightarrow \text{Bool}$ can be seen as set of natural numbers. This gives me a curiosity: what is the position of the sets of System T in the arithmetical hierarchy? and about the sets of System F? I searched in the literature, but I didn’t find anything.

Adding text to a hierarchy of items

Given a predefined hierarchy of foods, a user while viewing a specific food on the back-end can add/edit text associated with that specific food, its parent, and its grandparent. Text for each level is optional, and can be left blank.

For instance, if they are viewing “Beef Wellington”, they can add “Common for weddings.” to the specific food, “It’s whats for dinner.” to the parent (Beef), and “Has high protein.” to the grandparent (Meat). The text in the parenthesis shows sample text which they entered.

  1. Meat (Has high protein.)
    1. Beef (It’s whats for dinner.)
      1. Beef Wellington (Common for weddings.)
      2. Beef Stroganoff (Great for a cold day.)
    2. Chicken (Very versatile.)
      1. Chicken Cordon Bleu (Nice and cheesy.)
      2. Chicken Marsala (Great with mushrooms.)
  2. Vegetables (Low fat.)
    1. Broccoli (null)
      1. Steamed Broccoli (Yummy!)
  3. Grain (Good carbs.)
    1. Rice (A cheap grain.)
      1. Fried Rice (null)

Now, when another user is viewing “Beef Wellington” on the front-end, they would see (not able to edit):

  • Has high protein.
  • It’s whats for dinner.
  • Common for weddings.

And if that user views “Beef Stroganoff” on the front-end, they would see:

  • Has high protein.
  • It’s whats for dinner.
  • Great for a cold day.

How should the back-end user be able to add and edit text for the specific food, its parent, and its grandparent while viewing a specific food?

EDIT. I don’t necessarily like this approach, but this is one idea which might better communicate what I am trying to do.

enter image description here

Convert flat object hierarchy to json

I do work for a project currently, where the data is send to the server as application/x-www-form-urlencoded (which is bad, and it should be JSON, but unfortunately I am not able to change this one).

The following code snipped will transfer the given parameters (in a loop) to a Map, which can then be transformed to json (eg. by using jackson).

I would like to make this even better, so please post your comments and suggestions.

Parameter-List:

_id=[5bfad95450642c333010daca],  _rev=[1-9ce33949c3acd85cea6c58467e6a8144],  type=[Group],  user=[aUSer],  default=[aDetail],  store[aDetail][prop]=[5],  store[aDetail][lprop1][0][time]=[00:00],  store[aDetail][lprop1][0][value]=[14],  store[aDetail][lprop1][0][timeAsSeconds]=[0], store[aDetail][lprop1][1][time]=[07:00],  store[aDetail][lprop1][1][value]=[8],  store[aDetail][lprop1][1][timeAsSeconds]=[25200],  store[aDetail][anprop]=[25],  store[aDetail][lprop2][0][time]=[00:00],  store[aDetail][lprop2][0][value]=[61],  store[aDetail][lprop2][0][timeAsSeconds]=[0],    store[bDetail][prop]=[6],  store[bDetail][lprop1][0][time]=[00:10],  store[bDetail][lprop1][0][value]=[12],  store[bDetail][lprop1][0][timeAsSeconds]=[0], store[bDetail][lprop1][1][time]=[07:10],  store[bDetail][lprop1][1][value]=[9],  store[bDetail][lprop1][1][timeAsSeconds]=[25200],  store[bDetail][anprop]=[25],  store[bDetail][lprop2][0][time]=[00:00],  store[bDetail][lprop2][0][value]=[61],  store[bDetail][lprop2][0][timeAsSeconds]=[0],  created_at=[2018-01-11T20:48:22.574+0100], ... 

Code-Snippet:

fun parseToMap(map: MutableMap<String, Any>, key: String, value: Any): MutableMap<String, Any> {     val cleanedV = if (value is String) URLDecoder.decode(value, "UTF-8") else value      if (!key.contains("[")) {         map.putIfAbsent(key, cleanedV)     } else {         // mapKey is the key going to get stored in the map         val mapKey = key.substring(0, key.indexOf("["))          // nextKey is the next key pushed to the next call of parseToMap         var nextKey = key.removePrefix(mapKey)         nextKey = nextKey.replaceFirst("[", "").replaceFirst("]", "")          var isArray = false         var index = -1          if (nextKey.contains("[") &&                 nextKey.substring(0, nextKey.indexOf("[")).matches(Regex("[0-9]+"))) {             index = nextKey.substring(0, nextKey.indexOf("[")).toInt()             isArray = true         }          // mapkey used for object in list         val newMapKey = if (isArray) nextKey.substring(nextKey.indexOf("[") + 1, nextKey.indexOf("]")) else ""          val child: Any?         var childMap: MutableMap<String, Any> = mutableMapOf()          if (map.containsKey(mapKey)) {             println("key $  mapKey exists already")             child = map[mapKey]              when (child) {                 is MutableList<*> -> {                     if (child == null || child.isEmpty()) {                         childMap = mutableMapOf()                         val tmpList = child as MutableList<Any>                         tmpList.add(childMap)                         map.put(newMapKey, tmpList)                     } else {                         if (child.size > index) {                             childMap = child.get(index) as MutableMap<String, Any>                             childMap = parseToMap(childMap, newMapKey, value)                         } else {                             childMap = parseToMap(childMap, newMapKey, value)                             val tmpList = child as MutableList<Any>                             tmpList.add(childMap)                         }                     }                 }                 is MutableMap<*, *> -> childMap = map.get(mapKey) as MutableMap<String, Any>             }         } else {             if (isArray) {                 child = mutableListOf<Any>()                 childMap = parseToMap(childMap, newMapKey, value)                 child.add(childMap)                 map.put(mapKey, child)             } else {                 childMap = mutableMapOf<String, Any>()             }         }          if (!isArray) parseToMap(childMap, nextKey, value)          map.putIfAbsent(mapKey, childMap)     }      return map } 

Calling this method:

    decodedParameters.forEach { k, v -> run {         val cleanedV = v.toString().replace("[", "").replace("]", "")         jsonMap = parseToMap(jsonMap, k, cleanedV)     } } 

Asymmetric/Symmetric Encryption of a TPM key hierarchy

I know that keys in a TPM key hierarchy are encrypted with their parent keys. But I read that those parent keys (for instance an asymmetric SRK) need to have some symmetric secret for said encryption. Is is mandatory to encrypt child keys with a symmetric key or can I use the asymmetric keys as well? And if I can only use the symmetric ones, how are they generated?