## combinatory logic – Equality of lambda terms which do not have normal form

In the context of lambda calculus, how should one prove $$beta$$-equality of terms that do not have normal form?

In particular, how to prove that these are different combinators:
$$Y = λf.(λx.f(xx))(λx.f(xx)) \ Θ = (λxf.f(xxf))(λxf.f(xxf))$$
These work the same if we reduce them, but Wikipedia states that they are different, and that there are in fact infinitely many combinators that work the same as these.

## logic – Is the universal quantifier redundant?

Whenever we use the string

$$(forall x)P(x)$$

We are using a meta variable, in this case $$x$$, which stands for any object in the reference set.

However, the semantics of the symbol $$forall$$ indicate that we are refering to all objects that satisfy certain condition $$P(x)$$.

So, the semantics of “for all the objects over which the metavariable varies, $$P(x)$$” but we know, a priori, that the meta variable already refers to all the objects in the reference set.

This looks redundant to me.

So, is the universal quantifier redundant?

## logic – Two “bubble” loops in pseudocode; would they return the same thing?

I am trying to create a new form of a bubble loop and want to see if they would return the same truth values during runtime. Could I get a second pair of eyes to confirm if this is the case?

Note: prod is equal to a target product of a sequence.

``````Code #1
For c = 1 to x
For d = 1 to c - 1
If (a,c * a,d = prod) return True
End For

Code #2
For c = 1 to x
For d = c + 1 to x
If (a,c * a,d = prod) return True
End For
``````

I did data collection and found that in each case, the return true value would be the same. Is this always the case? If so, is this just because our index is simply starting at the second to the beginning as compared to skipping the end?

## logicboard – MacBook Pro 15″ Unibody Mid 2012 A1286 Replacing a damaged 2.6 Ghz logic board to 2.7 Ghz one

i have a question, i got a logic board A1286 mid-2012 non-retina 2.7 GHz.

On the board, there are two extra sockets; one is the right side of the fan connector and the other one is above the keyboard’s connector.

Mine also is A1286 2.6 GHz mid-2012-non retina same as the new board, but the sockets of mine are empty, Should i be worried about the installation? since there are no extra cables to be connected to those sockets.

New one(Please enlarge the picture and see the red circle)

https://d3nevzfk7ii3be.cloudfront.net/igi/LY3w64wUMFvYIHtE.huge

Mine

https://d3nevzfk7ii3be.cloudfront.net/igi/kIuNkBZVKdGWZEJL.full

Thank you

## Does Logic Pro X require GarageBand’s instrument library?

I’ve formerly have GarageBand and its instrument library installed, but since then I have “upgraded” to Logic Pro X and uninstalled GarageBand. Recently I’ve been running low on storage and found a bunch of music creation files labelled under “GarageBand”. I’m wondering whether these files are used by Logic Pro X, or are they just leftover GarageBand files that didn’t get deleted? Is it safe to remove them without messing up Logic Pro X?

## mac – MacBook Pro mid 2012 logic board swapping

Question here is I have an MCB with this IDs: Model id : MacBookPro9,2 and apple model number : A1278. It is MacBook Pro mid 2012 with I5 right now. I am thinking if there is any chance that I can upgrade/swap this logic board for better one but not for that what is used in other mid 2012 with I7 as it is only dual-core. Is there any chance that I can fit some logic board with quad-core I7 processor? Somewhere I have read that some logic board from 2015 can fit into it and it is quad-core.

Many thanks for every answer :]

## design patterns – Interfacing with records on remote DB from localhost Application Logic

There are times when I have to fix/update records on a Production and/or Staging environment for a Web App. These are remote DBs.

Rather than push application code to fix the data, I’ve been “interfacing” my localhost’s version of the running app with the remote DBs. I can do this by simply changing an ENV var for the DB URI.

I’m doing this as opposed to shelling into DB and updating records because I need some actual code to massage data too.

Any insights on this pattern? Thanks!

## set theory – Compactness number for a fragment of second-order logic

Previously asked and bountied without response at MSE.

This question is a companion to this one, about a tame(?) fragment of second-order logic with the standard semantics, $$mathsf{SOL}$$, motivated by the Tarski-Vaught test. The question is:

Working in $$mathsf{ZFC}$$ + “There is an extendible cardinal,” can the strong compactness number$$^1$$ of $$mathsf{SOL}_{TV}$$ be strictly less than the smallest extendible cardinal?

To keep things self-contained, here is the relevant definition. First, say $$mathfrak{A}trianglelefteqmathfrak{B}$$ iff $$mathfrak{A}subseteqmathfrak{B}$$ and $$varphi^mathfrak{B}not=emptyset impliesvarphi^mathfrak{B}cap mathfrak{A}^{arity(varphi)}not=emptyset$$ for every formula $$varphiinmathsf{SOL}$$. We then let $$mathsf{SOL}_{TV}$$ be the set of $$mathsf{SOL}$$-formulas which are absolute with respect to $$trianglelefteq$$, that is the set of $$varphiinmathsf{SOL}$$ such that whenever $$mathfrak{A}trianglelefteqmathfrak{B}$$ we have $$varphi^mathfrak{A}=varphi^mathfrak{B}capmathfrak{A}^{arity(varphi)}.$$

Note that despite having the downward Lowenheim-Skolem property, $$mathsf{SOL}_{TV}$$ is much stronger than first-order logic. For example, well-foundedness is $$mathsf{SOL}_{TV}$$-characterizable$$^2$$; this means that there is an $$mathsf{SOL}_{TV}$$-sentence pinning down $$mathbb{N}$$ up to isomorphism, which in turn implies that the $$mathsf{SOL}_{TV}$$-definable relations on $$mathbb{N}$$ are exactly the $$mathsf{SOL}$$-definable ones. Beyond this, not much is clear to me; the question above seems like it might be approachable.

At present I don’t see anything preventing the strong compactness number of $$mathsf{SOL}_{TV}$$ from being extremely small – although of course since $$mathsf{SOL}_{TV}$$ has the downward Lowenheim-Skolem property it must be uncountable by Lindstrom’s Theorem.

$$^1$$The strong compactness number of a logic $$mathcal{L}$$, if it exists at all, is the least cardinal $$kappa$$ such that every unsatisfiable $$mathcal{L}$$-theory has an unsatisfiable subtheory of cardinality $$. Large cardinals imply the existence of strong compactness numbers; in particular, second-order logic has a strong compactness number iff there is an extendible cardinal, in which case its strong compactness number is the least extendible. As an amusing aside, Vopenka’s Principle turns out to be equivalent to the existence of strong compactness numbers for all logics in a precise sense.

$$^2$$Since well-foundedness is preserved downwards, it’s enough to show (working in a language with a distinguished binary relation symbol $$<$$) that if $$mathfrak{A}trianglelefteq_{mathsf{SOL}}mathfrak{B}$$ and $$<^mathfrak{B}$$ is illfounded then $$<^mathfrak{A}=<^mathfrak{B}capmathfrak{A}$$ is illfounded. Consider first the formula $$psi(x)equiv$$ “The initial segment of $$<$$ below $$x$$ is ill-founded.” We have $$psi^mathfrak{B}not=emptyset$$, so there must be some $$ainmathfrak{A}$$ which is in the ill-founded part of $$<^mathfrak{B}$$. But now for each $$uinmathfrak{A}$$ in the ill-founded part of $$<^mathfrak{B}$$, consider the formula $$theta_u(y)equiv$$$$y and $$y$$ is in the ill-founded part of $$<$$.” Applying $$triangleleft_{mathsf{SOL}}$$-ness, we get that the set of elements of $$mathfrak{A}$$ which are in the ill-founded part of $$mathfrak{B}$$ has no $$<^mathfrak{B}$$-minimal element, which (together with its above-established nonemptiness) implies that $$<^mathfrak{A}$$ is ill-founded as desired.

## unity – How can I create a walking zone logic for my player?

First I will show a screenshot and explain the logic I think of and what I’m trying to do :

The small circle is the Player.

The black rectangle is the target the player is walking towards.

The green zone is where the player slow down. Once entering the green zone and facing the target by calculating the distance from the target the player start slowing down until stop.

When the player just rotating facing the opposite direction away from the target in this point something show switch the speed logic if the player was slow down to stop if the player is facing the opposite direction he can start walking again and the speed should be increasing slowly to the normal speed the same idea when slowing down to stop so speed up to normal.

Now if the player is leaving the green zone once left the green zone using a flag or some helper and reset everything so if the player will enter the green zone again facing the target he will slow down to stop again.

• When the player is getting some distance from the target and facing the target slow down to stop.

• When the player stopped and then if the player rotating facing the opposite direction let the player the option to move again with increasing the speed back to normal.

• When the player is moving away from the target some distance for example out the green zone reset everything and if the player will face the target again and enter the green zone as distance from target slow down to stop again.

This script is attached to some object and make the logic I wanted :

``````using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class FireEffect : MonoBehaviour
{
public GameObject player;
public GameObject longDistanceDescriptionTextImage;
public TextMeshProUGUI text;

private Animator playerAnimator;
private float timeElapsed = 0;
private float lerpDuration = 3;
private float startValue = 1;
private float endValue = 0;
private float valueToLerp = 0;
private float angle;

// Start is called before the first frame update
void Start()
{
angle = transform.eulerAngles.y;
playerAnimator = player.GetComponent<Animator>();
}

// Update is called once per frame
void Update()
{
var distance = Vector3.Distance(player.transform.position, transform.position);

Vector3 dir = (transform.position - player.transform.position).normalized;
float dot = Vector3.Dot(dir, player.transform.forward);

angle = transform.eulerAngles.y;
if (distance < 10 && dot > 0.9f)
{
if (timeElapsed < lerpDuration)
{
valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);
playerAnimator.SetFloat("Forward", valueToLerp);
timeElapsed += Time.deltaTime;
}
playerAnimator.SetFloat("Forward", valueToLerp);
longDistanceDescriptionTextImage.SetActive(true);
text.text = "It's too hot , I can't continue.";
}
else
{
if (dot < -0.9f)
{
if (timeElapsed > lerpDuration)
{
valueToLerp = Mathf.Lerp(endValue, startValue, timeElapsed / lerpDuration);
playerAnimator.SetFloat("Forward", valueToLerp);
timeElapsed += Time.deltaTime;
}
playerAnimator.SetFloat("Forward", valueToLerp);
}
}
}
}
``````

I’m not sure if this is the right way to make the script but it does working for the slow down to stop part :

``````if (distance < 10 && dot > 0.9f)
{
if (timeElapsed < lerpDuration)
{
valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);
playerAnimator.SetFloat("Forward", valueToLerp);
timeElapsed += Time.deltaTime;
}
playerAnimator.SetFloat("Forward", valueToLerp);
longDistanceDescriptionTextImage.SetActive(true);
text.text = "It's too hot , I can't continue.";
}
``````

but it’s not working in the else part the speed is not increasing slowly back to normal but increasing at once to normal. The lerp is not working for the increasing back.

another problem is when the player in the else part facing away from the target if I will rotate the player with the keys and move him again to the target he will walk regular nonstop to the target without slow down again.

I’m not sure what logic should be here for 100% but I think if the player is facing away from the target start increasing to normal speed and if in the middle I rotate the player facing the target again because I’m inside the green zone then slow down to stop the player maybe a bit faster to keep the same 10 distance like in the script from the target. Don’t let the player to pass over the 10 distance from the target when facing the target.

## unity – How can I add some logic to the interactable script that it will interact with items only from the front of the items?

``````using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System;

public class InteractableItem : MonoBehaviour
{
public string currentMode;

public enum InteractableMode
{
Description,
Action,
ActionWithoutThrow
};

public InteractableMode interactableMode = InteractableMode.Description;
public float distance;

(TextArea(1, 10))
public string description = "";

public bool IsAnyAction()
{
return interactableMode == InteractableMode.ActionWithoutThrow || interactableMode == InteractableMode.Action;
}

public bool IsActionWithoutThrow()
{
return interactableMode == InteractableMode.ActionWithoutThrow;
}

private void Start()
{
currentMode = GetComponent<InteractableItem>().interactableMode.ToString();
}

private void Update()
{

}
}

/*
var heading = transform.position - player.transform.position;

if (dot > 1)
*/
``````

The idea I think is to use Vector3.Dot at the bottom of the script I have an example of using it in another script but I want to add another enum or using the current enum in the script with option for interact with the item/s only if the player is looking at the item from the front.

Maybe to include also some angle/s limits for the front view but the idea is that I will be able to set option for each item if to look only from the front or from any side 360 degrees around.

This is a line from another script for example how I check for interaction with item :

``````if (RightHandToTarget && primaryTarget.IsAnyAction())
``````

primaryTarget is InteractableItem type.

so to add and make something like :

``````if (RightHandToTarget && primaryTarget.IsAnyAction() && primaryTarget.LookFromFrontView)
``````

This is the main idea logic.

and this is the full script that is attached to the player that use the InteractableItem script for interactable with items it’s a bit long so I put it in pastebin.com :

https://pastebin.com/meEuzYRx

I tried this so far since the InteractableItem script is attached to each object I want to be interactable item I added some stuff :

``````using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System;

public class InteractableItem : MonoBehaviour
{
public string currentMode;

private Transform player;

private void Awake()
{
player = GameObject.Find("Player").transform;
}

public enum InteractableMode
{
Description,
Action,
ActionWithoutThrow
};

public enum ViewMode
{
FrontView,
AllView
};

public ViewMode viewMode = ViewMode.AllView;

public InteractableMode interactableMode = InteractableMode.Description;
public float distance;

(TextArea(1, 10))
public string description = "";

public bool IsAnyAction()
{
return interactableMode == InteractableMode.ActionWithoutThrow || interactableMode == InteractableMode.Action;
}

public bool IsActionWithoutThrow()
{
return interactableMode == InteractableMode.ActionWithoutThrow;
}

private void Start()
{
currentMode = GetComponent<InteractableItem>().interactableMode.ToString();
}

private void Update()
{
var heading = transform.position - player.transform.position;

if (viewMode == ViewMode.FrontView && dot > 1)
{
Debug.Log("Front View");
}
else
{
Debug.Log("Any View");
}
}
}
``````

First I find the Player then at the bottom I find if the player is looking from the front or from the other sides on the item and then added new enum for view mode selection. If it’s FrontView or AllView.

The problem now is how to use the first enum conditions with the second enum conditions in the Update ? The FrontView or AllView is working with the Vector3.Dot but now I need to use both enums and not sure how.

This is working but still not perfect still need to change/add things :

``````using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System;

public class InteractableItem : MonoBehaviour
{
public string currentMode;

private Transform player;
private bool frontView = false;
private InteractableMode currentInteractableMode;

private void Awake()
{
player = GameObject.Find("Player").transform;
}

public enum InteractableMode
{
Description,
Action,
ActionWithoutThrow,
NoAction
};

public enum ViewMode
{
FrontView,
AllView
};

public ViewMode viewMode = ViewMode.AllView;

public InteractableMode interactableMode = InteractableMode.Description;
public float distance;

(TextArea(1, 10))
public string description = "";

public bool IsAnyAction()
{
return interactableMode == InteractableMode.ActionWithoutThrow || interactableMode == InteractableMode.Action;
}

public bool IsActionWithoutThrow()
{
return interactableMode == InteractableMode.ActionWithoutThrow;
}

private void Start()
{
currentMode = GetComponent<InteractableItem>().interactableMode.ToString();
currentInteractableMode = GetComponent<InteractableItem>().interactableMode;
}

private void Update()
{
var heading = transform.position - player.transform.position;

if((interactableMode == InteractableMode.ActionWithoutThrow ||
interactableMode == InteractableMode.Action ||
interactableMode == InteractableMode.Description) && viewMode == ViewMode.FrontView
&& dot < 1)
{
interactableMode = InteractableMode.NoAction;
}

if (interactableMode == InteractableMode.NoAction && viewMode == ViewMode.FrontView
&& dot > 1)
{
interactableMode = currentInteractableMode;
}
}
}
``````