Use the Rice’s theorem to prove that the following property of a Recursive Enumerable language L is undecidable

This exercise was taken from the book “Languages and Machines: An Introduction to the Theory of Computation” by Thomas Sudkamp. It refers to exercise 12 (b) chapter 12. Given a language L which is recursive enumerable, I have to prove that the following property is undecidable:

  • L is finite

The text says that it is sufficient to prove that it is a non trivial property.

I tried to solve the exercise as follow:

Consider the empty language $ \emptyset$ , which contains only the empty string λ, in other words $ \emptyset$ = {$ \lambda$ }. Then $ \emptyset^-$ which is the negation of the empty set, will contains some string which is not $ \lambda$ . By doing this, I’ve found a language which is finite and does satisfy the property, but I’ve also found another language which doesn’t satisfy the property because $ \emptyset^-$ it is not finite. In conclusion the property it is not trivial, and by the Rice’s theorem it is impossible to decide that property.

I’m not sure if I’m doing the right thing here and I haven’t found any solution to this exercise… Can anyone help or at least tell me if I’m doing it right?

Thank you very much.

What is the property of a PL that extracting a subroutine should not change the meaning?

What is the name of the property of a Programming Language that says that extracting a subprogram into a subroutine and using that subroutine instead of the subprogram should not change the meaning of the program?

I could swear that this exists and that it has a well-known name, but I can’t for the life of me remember it. My efforts to search for the name have been thwarted by being swamped with results for the Liskov Substitution Principle or Referential Transparency.

What I am looking for is the property that I should be able to replace

printf("Hello"); 

with

void hello() {     printf("Hello"); }  hello();  

without changing the meaning of the program.

I think it is named after the person who coined it, but I am not sure. Something like XYZ Equivalence or XYZ Principle where XYZ is the name of a well-known Computer Scientist. I want to say Strachey, but I couldn’t find a mention of anything similar in Fundamental Concepts in Programming Languages.

How to add apply_filter for a class property in plugin

I am trying to add an apply_filters function to a property of a class so that the form fields could be added to from another plugin or functions.php but I just can’t get the $ filter_fields to set. Can anyone tell me what I’m doing wrong? When I echo out $ form_fields I get the h4 and the submit button but no fields.

class-registration-form.php

class RegForm {            // Properties         private $  fields;          private $  filter_fields;           // Constructor         function __construct(){              $  this->fields = array(                 'name'      => '<label>Name.</label><br>                                 <input type="text" name="name"><br>',                 'business name' => '<label>Business Name.</label><br>                                 <input type="text" name="business_name"><br>',                 'email'     => '<label>Email.</label><br>                                 <input type="email" required="required" name="email"><br>',                 'password'  => '<label>Password.</label><br>                                 <input type="password" required="required" name="password"><br>'                 );              add_shortcode('registerform', array($  this, 'create_reg_form'));          }            // Methods              public function init (){                 $  filter_fields = apply_filters('tbg_reg_fields', $  this->fields);             }              public function create_reg_form ($  filter_fields){                  $  form_fields = implode($  this->filter_fields);                   ?>                     <h4>Register as a New Store Owner</h4>                         <form method="post" class="tbg_reg_form" action="' . admin_url( 'admin-ajax.php' ) . '">                             <?php echo $  form_fields; ?>                             <input type="hidden" name="action" value="tbg_form_submit">                             <input type="submit" value="Start Selling Now">                         </form>                     <?php                     }                 }          $  newForm = new RegForm;         add_action ('plugins_loaded', [$  newForm, 'init']); 

and in the themes functions.php file I have

    // Registration Fields   function add_age_field($  new_fields) {     $  new_fields[] = '<label>Website.</label><br><input type="text" name="website"><br>';     return $  new_fields; }  add_filter('tbg_reg_fields', 'add_age_field'); 

Pathfinder 1-e, if a paladin uses their divine bond to give their weapon a special property, what means would players have of identifying it?

A paladin’s 5th level Spell like ability Divine bond allows them to give their divine bonded weapon a level based enhancement bonus or an equivalent special property picked from axiomatic, brilliant energy, defending, disruption, flaming, flaming burst, holy, keen, merciful, and speed. I’d like to know how a player character might identify the property picked when facing a paladin.

Normally, per this stackexchange, when identifying the properties of a magic item that isn’t a potion or a scroll, you esentially have to use a magic spell. Either detect magic, identify, or analyze-dweomer.

But divine bond is a spell like ability and a “spell-like ability works just like the spell of that name”. Spell effects in place can be identified with a DC20+spell level Knowledge arcana check. If a character class grants a spell-like ability that is not based on an actual spell, the ability’s effective spell level is equal to the highest-level class spell the character can cast, and is cast at the class level the ability is gained, which makes, I believe, this a DC between 21 and 24.

On top of that, a knowledge religion check of 10+ class level when the feature is granted can identify a class feature from a class that grants divine spells, which for a paladin would be a DC 15 knowledge religion check. Would this identify the choices the paladin has made, or just the options they have available to them?

Would a knowledge arcana check identify the bonus granted (and the level the spell was cast at) by the spell Magic Weapon, Greater, or just that it was cast? Would that sort of granularity apply to a clas feature/spell like ability?

Does the “reappearing” property of the “Shadowneedle” Unbreakable Arrow function?

In Adventurers League play, it is possible to find a “Shadowneedle” (Unbreakable arrow), which has this special text :

One of twenty unbreakable arrows crafted with Shadowsong [A flavored Oathbow that could be found in Adventurers League play in the past, and is still tradeable today], when this arrow is nocked onto the Oathbow and leveled at an opponent, a gentle hum fills the wielder’s mind, steadying their hand and steeling their focus (this feature has no mechanical effect). When [the Shadowneedle is] fired from Shadowsong, the wielder may say the words “Needles, return to your thread” to make this arrow (and any other in its set loosed from the wielder’s hand) reappear in the wielder’s quiver.

However, ammunition are apparently considered as Consumables in general, and the Dungeon Master’s Guide has a section on such items :

Some items are used up when they are activated. A potion or an elixir must be swallowed, or an oil applied to the body. The writing vanishes from a scroll when it is read. Once used, a consumable item loses its magic.

Does that mean that a Shadowneedle, even when shot from Shadowsong, loses its magical properties and thus won’t fly back when the words are spoken ? Or am I (hopefully) missing something, making the “reappearing” property of the Shadowneedle function properly ?

Proving that Rice’s theorem does not apply to a property

This is related to an assignment, but I would still appreciate help in formalising proof either through private message or on this topic.

The question is about if Rice theorem applies to certain property. For example for a structural property such as number of states. I would argue that:

  • The property is decidable through its definition in encoded form.
  • The property is irrelevant to the language, because given the same language we can easily find another TM that does not have this property, ie one with empty states, so the property is not a language property, and hence Rice Theorem does not apply, since by definition, Rice theory only applies if it is a non trivial language property.

To me, this seems to be a good argument, but the question is assign a substantial mark of 10, and I feel like this is not enough for 10 marks, am I missing out some rigorous argument that I need to include to make my explanation crystal clear?

Cannot seem to access Calculated column in Display Template via Managed Property mapping

Here is my situation:

I have a test/development site on SharePoint Online/Office 365 called TestSite3, and within that site a sub-site called TestBlog3 (a Blog site for making Posts).

I want to use a Content Search Web Part on the homepage to query all Post items from the blog, and then sort them by a custom event date value, but then if event date is not specified (it will be optional), use the post’s created date.

I have also made a custom Display Template in which I have the following managed property mappings:

<mso:ManagedPropertyMapping msdt:dt="string">'Picture URL'{Picture URL}:'PublishingImage;PictureURL;PictureThumbnailURL','Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'LastModifiedTime','Line 3'{Line 3}:'BodyOWSMTXT','Line 4'{Line 4}:'RefinableDate03','SecondaryFileExtension','ContentTypeId','IsAllDayEvent'</mso:ManagedPropertyMapping> 

In the Post content type, I have added two custom columns:

  • ZTest3Date: a Date column that is optional to the user to specify, supposed to function as an ‘event date’ for posts about events coming up
  • ZTest3Calculated: a Calculated column returning a Date. What I want is for it to return the event date (ZTest3Date) if it is set, otherwise return the post’s created date (Created).

Here is the formula I have in ZTest3Calculated: =IF(ISBLANK(ZTest3Date),Created,ZTest3Date)

I have seen formulas use brackets [] around the column names, but when I try saving the formula with that it automatically removes them, leaving the above.

I go into the site’s search schema to look at the Managed and Crawled Properties. I use ‘z’ in the search box to filter them down. The ZTest3Date column I made shows up in Managed Properties as ZTest3DateOWSDATE. There is no Managed Property for the ZTest3Calculated column.

In Crawled Properties, I see ows_ZTest3Calculated, ows_ZTest3Date, and ows_q_DATE_ZTest3Date.

I can put ZTest3DateOWSDATE into my Display Template in Line 4 and it works, but that’s only half my solution; I want to handle when there is no event date set.

Since ZTest3Calculated is not available as a managed property, I understand that it is recommended to map the crawled property to one of the pre-set columns SharePoint provides, so I mapped ows_ZTest3Calculated to RefinableDate03.

I have re-indexed the Post list and waited a while, but it does not seem to be working; I have also tried assigning an alias to RefinableDate03 and updating the Display Template, still no luck. When I debug the JavaScript code I put in my display template file to read what is coming into Line 4, it is blank always, whether or not the event date is set. So either the RefinableDate03 mapping isn’t working, or my ZTest3Calculated column isn’t working. Or something else I’m not aware of.

Sorry this is so long, but I feel like supplying the context and my setup is important. I have driven myself crazy with this over the past few days, and would appreciate if someone might have some knowledge of what I’m missing.

I appreciate any help, and thank you for reading all this!

Cannot seem to access Calculated column in Display Template via Managed Property mapping

Here is my situation:

I have a test/development site on SharePoint Online/Office 365 called TestSite3, and within that site a sub-site called TestBlog3 (a Blog site for making Posts).

I want to use a Content Search Web Part on the homepage to query all Post items from the blog, and then sort them by a custom event date value, but then if event date is not specified (it will be optional), use the post’s created date.

I have also made a custom Display Template in which I have the following managed property mappings:

<mso:ManagedPropertyMapping msdt:dt="string">'Picture URL'{Picture URL}:'PublishingImage;PictureURL;PictureThumbnailURL','Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'LastModifiedTime','Line 3'{Line 3}:'BodyOWSMTXT','Line 4'{Line 4}:'RefinableDate03','SecondaryFileExtension','ContentTypeId','IsAllDayEvent'</mso:ManagedPropertyMapping> 

In the Post content type, I have added two custom columns:

  • ZTest3Date: a Date column that is optional to the user to specify, supposed to function as an ‘event date’ for posts about events coming up
  • ZTest3Calculated: a Calculated column returning a Date. What I want is for it to return the event date (ZTest3Date) if it is set, otherwise return the post’s created date (Created).

Here is the formula I have in ZTest3Calculated: =IF(ISBLANK(ZTest3Date),Created,ZTest3Date)

I have seen formulas use brackets [] around the column names, but when I try saving the formula with that it automatically removes them, leaving the above.

I go into the site’s search schema to look at the Managed and Crawled Properties. I use ‘z’ in the search box to filter them down. The ZTest3Date column I made shows up in Managed Properties as ZTest3DateOWSDATE. There is no Managed Property for the ZTest3Calculated column.

In Crawled Properties, I see ows_ZTest3Calculated, ows_ZTest3Date, and ows_q_DATE_ZTest3Date.

I can put ZTest3DateOWSDATE into my Display Template in Line 4 and it works, but that’s only half my solution; I want to handle when there is no event date set.

Since ZTest3Calculated is not available as a managed property, I understand that it is recommended to map the crawled property to one of the pre-set columns SharePoint provides, so I mapped ows_ZTest3Calculated to RefinableDate03.

I have re-indexed the Post list and waited a while, but it does not seem to be working; I have also tried assigning an alias to RefinableDate03 and updating the Display Template, still no luck. When I debug the JavaScript code I put in my display template file to read what is coming into Line 4, it is blank always, whether or not the event date is set. So either the RefinableDate03 mapping isn’t working, or my ZTest3Calculated column isn’t working. Or something else I’m not aware of.

Sorry this is so long, but I feel like supplying the context and my setup is important. I have driven myself crazy with this over the past few days, and would appreciate if someone might have some knowledge of what I’m missing.

I appreciate any help, and thank you for reading all this!

The property or field ‘ItemCount’ has not been initialized. It has not been requested or the request has not been executed

I have the following code inside our server-side event receiver, the code should connect to a sharepoint online list and get the total number of items, here is the code:-

   try    {      currentItem["Status"] = "Pending";      if (currentItem.ContentType.Name.ToLower().Contains("project"))         {             using (ClientContext context = new ClientContext("https://***.sharepoint.com/"))            {              string s = "***";              SecureString passWord = new SecureString();              foreach (var c in s)              passWord.AppendChar(c);              context.Credentials = new SharePointOnlineCredentials("admin@****.onmicrosoft.com", passWord);              List list = context.Web.Lists.GetByTitle("Project");              context.ExecuteQuery();              var countItems = list.ItemCount;            }          }    }    catch (Exception e)    {      var errormessage = e.Message;    } 

but i am getting this exception:-

Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException was caught   HResult=-2146233079   Message=The property or field 'ItemCount' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.   Source=Microsoft.SharePoint.Client.Runtime   StackTrace:        at Microsoft.SharePoint.Client.ClientObject.CheckUninitializedProperty(String propName)        at Microsoft.SharePoint.Client.List.get_ItemCount()        at OrderManagement.EventReceiver1.EventReceiver1.ItemUpdated(SPItemEventProperties properties)   InnerException:  

So can anyone advice how i can fix this issue?

SPServices.SPAutocomplete cannot read property ‘find’ of undefined

I have created a SharePoint page and inserted text box using content editor web part with title of FilterTextBox

<input type="text" title="FilterTextBox"/> 

and I have inserted below script using Script Editor web part

<script language="javascript" type="text/javascript">     $  (document).ready(function() {         $  ().SPServices.SPAutocomplete({              sourceList: "Country",             sourceColumn: "Title",             columnName: "FilterTextBox",             ignoreCase: true,             numChars: 3,             slideDownSpeed: 1000,             debug: true         });     }); </script> 

but I get the following error when page load

Uncaught TypeError: Cannot read property ‘find’ of undefined

what might be wrong with my code ? thanks .