This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- op(350, yfx, @). | |
:- set_prolog_flag(occurs_check, error). | |
:- det(inference/3). | |
inference(true, bool, _). | |
inference(false, bool, _). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- op(600, yfx, '@'). % Function application | |
:- op(450, xfy, '=>'). % Type variable quantification | |
:- op(1150, fx, mode). | |
% Defines/validates a typing context. | |
tcx([]). | |
tcx([X-Sigma | Tcx]) :- | |
atom(X), | |
sigma_type(Sigma), | |
tcx(Tcx). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE PatternSynonyms #-} | |
import Data.Maybe | |
import Control.Monad.State | |
import Data.List | |
data Ty | |
= Unit -- The unit type. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE PatternSynonyms #-} | |
import Debug.Trace ( trace ) | |
type Ident = String | |
data Value | |
= Var Ident | |
| Bool Bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- module(cfg_macro, [ | |
op(1200, xfx, ++>) | |
]). | |
:- op(1200, xfx, ++>). | |
/* | |
The rule: | |
s ++> np(blah), vp. | |
translates to: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Number = singular | plural | |
data Person = 1st | 2nd | 3rd | |
data Gender = nonbinary | feminine | masculine | neutral | |
rule start = english_sentence + "." | |
rule english_sentence | |
= pronoun.Number.Person.Gender are.Number.Person.Gender adj | |
| subj.N1.G1 verb.N1.G1 obj.N2.G2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--OPTION 1 (CURRENT SYNTAX)---- | |
rule whatever1 = "something" | |
rule whatever2.Thing = | |
.thing1 -> "something 1" | |
.thing2 -> "something 2" | |
rule whatever3.Thing.Thing = | |
.thing1 { | |
.thing1 -> "something 1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 Ways to Leave Your Lover | |
Paul Simon | |
-----------------------------------CHORDS--------------------------------------- | |
Cmaj7 = x35453 (close to barred C) | |
B7 = x24242 (barred) | |
D#dim = 23424x (kinda like barred B7, but add middle finger) | |
D/F# = 200232 (wrap thumb around onto lowest string @ fret #2) | |
G = 355433 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- # Generating Center Embeddings | |
-- [This wikipedia article](https://en.wikipedia.org/wiki/Center_embedding) is about a kind of sentence that is REALLY hard to understand. Click the "Generate" button in the top right to generate sentences! | |
rule start = center_embedding | |
rule center_embedding = subject verb_phrase + "." | |
rule verb_phrase | |
= "slept" | |
| "killed" subject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- # Beginners Tutorial: Lesson 4 | |
-- ### Data Variant Aliases | |
-- In this lesson you'll learn how to display data variants in user-friendly ways. | |
-- Say you wanted to write a story about a character. | |
data Character = val | sam | penny | |
rule story = name.Character "went to the store." |
NewerOlder